25
$\begingroup$

Bug introduced in 10.0 and persisting through 11.3.0.0 or later


I had updated my mathematica to version 10 few days ago. And I had been shocked by the following fact:

s = FunctionInterpolation[Sin[x], {x, 0, 1}];
RegionPlot[InverseFunction[s][x] <= y, {x, -1, 1}, {y, -1, 1}]       
(* -1.13757 *)

Oh, my god! It is a number rather than a graph.

It seem like a bug about InverseFunction, FunctionInterpolation and RegionPlot because I then try another code:

s = FunctionInterpolation[Sin[x], {x, 0, 1}];
RegionPlot3D[InverseFunction[s][x] <= y z, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]

It certainly get the graph!

I later tried to use version 9 with the first code:

s = FunctionInterpolation[Sin[x], {x, 0, 1}];
RegionPlot[InverseFunction[s][x] <= y, {x, -1, 1}, {y, -1, 1}]

a graph got as well.

$\endgroup$
  • 1
    $\begingroup$ Normally, bugs is reserved for when the community believes something is a bug, and should not be applied without that input. However, I'll confirm it, and it's certainly odd. $\endgroup$ – rcollyer Apr 11 '15 at 12:19
  • 4
    $\begingroup$ I've reported it. $\endgroup$ – rcollyer Apr 11 '15 at 12:31
  • $\begingroup$ I do not know if it was urgent but in waiting for a solution is this usefull ? Plot[{InverseFunction[s][x], x}, {x, -1, 1}, Filling -> {1 -> {{2}, {Red, None}}}] $\endgroup$ – cyrille.piatecki May 25 '16 at 3:47
  • $\begingroup$ Still a problem under V11.0.0, though it now returns Show[-1.13757, DisplayFunction -> Identity] $\endgroup$ – mikado Aug 22 '16 at 18:41
  • $\begingroup$ However, this works RegionPlot[InverseFunction[Sin][x] <= y, {x, -1, 1}, {y, -1, 1}]... $\endgroup$ – José Antonio Díaz Navas Nov 11 '17 at 20:08
1
$\begingroup$

Turning great comments into an answer.

It is a bug (I tested on V11.1) and can be worked around by using Plot instead. For completeness I also demonstrate, how to get the edge back:

s = FunctionInterpolation[Sin[x], {x, 0, 1}];
g = Plot[{InverseFunction[s][x], x}, {x, -1, 1}, 
   Filling -> {1 -> {{2}, {Lighter@Blue, None}}}, PlotStyle -> None];
gc = Cases[g[[1]], _GraphicsComplex];
Graphics[{EdgeForm[AbsoluteThickness[3]], 
  gc /. EdgeForm[___] :> EdgeForm[Black]}, Frame -> True, 
 AspectRatio -> 1]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.