(FPCore (x) :precision binary64 (pow (/ (sqrt x) (sqrt x)) 4.0))
double code(double x) { return pow((sqrt(x) / sqrt(x)), 4.0); }
real(8) function code(x) real(8), intent (in) :: x code = (sqrt(x) / sqrt(x)) ** 4.0d0 end function
public static double code(double x) { return Math.pow((Math.sqrt(x) / Math.sqrt(x)), 4.0); }
def code(x): return math.pow((math.sqrt(x) / math.sqrt(x)), 4.0)
function code(x) return Float64(sqrt(x) / sqrt(x)) ^ 4.0 end
function tmp = code(x) tmp = (sqrt(x) / sqrt(x)) ^ 4.0; end
code[x_] := N[Power[N[(N[Sqrt[x], $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 4.0], $MachinePrecision]
\begin{array}{l} \\ {\left(\frac{\sqrt{x}}{\sqrt{x}}\right)}^{4} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x) :precision binary64 (pow (/ (sqrt x) (sqrt x)) 4.0))
double code(double x) { return pow((sqrt(x) / sqrt(x)), 4.0); }
real(8) function code(x) real(8), intent (in) :: x code = (sqrt(x) / sqrt(x)) ** 4.0d0 end function
public static double code(double x) { return Math.pow((Math.sqrt(x) / Math.sqrt(x)), 4.0); }
def code(x): return math.pow((math.sqrt(x) / math.sqrt(x)), 4.0)
function code(x) return Float64(sqrt(x) / sqrt(x)) ^ 4.0 end
function tmp = code(x) tmp = (sqrt(x) / sqrt(x)) ^ 4.0; end
code[x_] := N[Power[N[(N[Sqrt[x], $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 4.0], $MachinePrecision]
\begin{array}{l} \\ {\left(\frac{\sqrt{x}}{\sqrt{x}}\right)}^{4} \end{array}
(FPCore (x) :precision binary64 1.0)
double code(double x) { return 1.0; }
real(8) function code(x) real(8), intent (in) :: x code = 1.0d0 end function
public static double code(double x) { return 1.0; }
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l} \\ 1 \end{array}
Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
herbie shell --seed 1
(FPCore (x)
:name "pow(sqrt(x)/sqrt(x), 4)"
:precision binary64
:pre (and (<= 1e-5 x) (<= x 0.1))
(pow (/ (sqrt x) (sqrt x)) 4.0))