(FPCore (x) :precision binary64 (/ (sqrt (* x (- x 1.0))) (- x 2.0)))
double code(double x) { return sqrt((x * (x - 1.0))) / (x - 2.0); }
real(8) function code(x) real(8), intent (in) :: x code = sqrt((x * (x - 1.0d0))) / (x - 2.0d0) end function
public static double code(double x) { return Math.sqrt((x * (x - 1.0))) / (x - 2.0); }
def code(x): return math.sqrt((x * (x - 1.0))) / (x - 2.0)
function code(x) return Float64(sqrt(Float64(x * Float64(x - 1.0))) / Float64(x - 2.0)) end
function tmp = code(x) tmp = sqrt((x * (x - 1.0))) / (x - 2.0); end
code[x_] := N[(N[Sqrt[N[(x * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\sqrt{x \cdot \left(x - 1\right)}}{x - 2} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x) :precision binary64 (/ (sqrt (* x (- x 1.0))) (- x 2.0)))
double code(double x) { return sqrt((x * (x - 1.0))) / (x - 2.0); }
real(8) function code(x) real(8), intent (in) :: x code = sqrt((x * (x - 1.0d0))) / (x - 2.0d0) end function
public static double code(double x) { return Math.sqrt((x * (x - 1.0))) / (x - 2.0); }
def code(x): return math.sqrt((x * (x - 1.0))) / (x - 2.0)
function code(x) return Float64(sqrt(Float64(x * Float64(x - 1.0))) / Float64(x - 2.0)) end
function tmp = code(x) tmp = sqrt((x * (x - 1.0))) / (x - 2.0); end
code[x_] := N[(N[Sqrt[N[(x * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\sqrt{x \cdot \left(x - 1\right)}}{x - 2} \end{array}
(FPCore (x) :precision binary64 (/ (* (- x -2.0) (sqrt (* (- x 1.0) x))) (fma x x -4.0)))
double code(double x) { return ((x - -2.0) * sqrt(((x - 1.0) * x))) / fma(x, x, -4.0); }
function code(x) return Float64(Float64(Float64(x - -2.0) * sqrt(Float64(Float64(x - 1.0) * x))) / fma(x, x, -4.0)) end
code[x_] := N[(N[(N[(x - -2.0), $MachinePrecision] * N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(x * x + -4.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\left(x - -2\right) \cdot \sqrt{\left(x - 1\right) \cdot x}}{\mathsf{fma}\left(x, x, -4\right)} \end{array}
Initial program 99.9%
lift-/.f64
N/A
lift--.f64
N/A
flip--
N/A
associate-/r/
N/A
associate-*l/
N/A
lower-/.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
sub-neg
N/A
lower--.f64
N/A
metadata-eval
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
99.9
Applied rewrites99.9%
(FPCore (x) :precision binary64 (if (<= (/ (sqrt (* x (- x 1.0))) (- x 2.0)) -5e-155) (/ (sqrt (- (* x x) x)) -2.0) (fma (pow x -1.0) (+ (/ 2.875 x) 1.5) 1.0)))
double code(double x) { double tmp; if ((sqrt((x * (x - 1.0))) / (x - 2.0)) <= -5e-155) { tmp = sqrt(((x * x) - x)) / -2.0; } else { tmp = fma(pow(x, -1.0), ((2.875 / x) + 1.5), 1.0); } return tmp; }
function code(x) tmp = 0.0 if (Float64(sqrt(Float64(x * Float64(x - 1.0))) / Float64(x - 2.0)) <= -5e-155) tmp = Float64(sqrt(Float64(Float64(x * x) - x)) / -2.0); else tmp = fma((x ^ -1.0), Float64(Float64(2.875 / x) + 1.5), 1.0); end return tmp end
code[x_] := If[LessEqual[N[(N[Sqrt[N[(x * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision], -5e-155], N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] / -2.0), $MachinePrecision], N[(N[Power[x, -1.0], $MachinePrecision] * N[(N[(2.875 / x), $MachinePrecision] + 1.5), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{x \cdot \left(x - 1\right)}}{x - 2} \leq -5 \cdot 10^{-155}:\\ \;\;\;\;\frac{\sqrt{x \cdot x - x}}{-2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({x}^{-1}, \frac{2.875}{x} + 1.5, 1\right)\\ \end{array} \end{array}
if (/.f64 (sqrt.f64 (*.f64 x (-.f64 x #s(literal 1 binary64)))) (-.f64 x #s(literal 2 binary64))) < -4.9999999999999999e-155
Initial program 99.9%
lift-*.f64
N/A
lift--.f64
N/A
distribute-lft-out--
N/A
*-rgt-identity
N/A
lower--.f64
N/A
lower-*.f64
99.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites94.0%
if -4.9999999999999999e-155 < (/.f64 (sqrt.f64 (*.f64 x (-.f64 x #s(literal 1 binary64)))) (-.f64 x #s(literal 2 binary64)))
Initial program 99.3%
Taylor expanded in x around inf
+-commutative
N/A
unpow2
N/A
associate-/r*
N/A
metadata-eval
N/A
associate-*r/
N/A
associate-*l/
N/A
metadata-eval
N/A
associate-*r/
N/A
distribute-rgt-out
N/A
lower-fma.f64
N/A
lower-/.f64
N/A
+-commutative
N/A
lower-+.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
92.1
Applied rewrites92.1%
Final simplification94.0%
(FPCore (x) :precision binary64 (* (/ (sqrt (* (- x 1.0) x)) (fma x x -4.0)) (- x -2.0)))
double code(double x) { return (sqrt(((x - 1.0) * x)) / fma(x, x, -4.0)) * (x - -2.0); }
function code(x) return Float64(Float64(sqrt(Float64(Float64(x - 1.0) * x)) / fma(x, x, -4.0)) * Float64(x - -2.0)) end
code[x_] := N[(N[(N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] / N[(x * x + -4.0), $MachinePrecision]), $MachinePrecision] * N[(x - -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\sqrt{\left(x - 1\right) \cdot x}}{\mathsf{fma}\left(x, x, -4\right)} \cdot \left(x - -2\right) \end{array}
Initial program 99.9%
lift-/.f64
N/A
lift--.f64
N/A
flip--
N/A
associate-/r/
N/A
lower-*.f64
N/A
lower-/.f64
N/A
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
sub-neg
N/A
lower-fma.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
sub-neg
N/A
lower--.f64
N/A
metadata-eval
99.9
Applied rewrites99.9%
(FPCore (x) :precision binary64 (if (<= x -1e-308) (/ (sqrt (- x)) (- x 2.0)) (/ (+ (- -0.5 (/ 0.125 x)) x) (- x 2.0))))
double code(double x) { double tmp; if (x <= -1e-308) { tmp = sqrt(-x) / (x - 2.0); } else { tmp = ((-0.5 - (0.125 / x)) + x) / (x - 2.0); } return tmp; }
real(8) function code(x) real(8), intent (in) :: x real(8) :: tmp if (x <= (-1d-308)) then tmp = sqrt(-x) / (x - 2.0d0) else tmp = (((-0.5d0) - (0.125d0 / x)) + x) / (x - 2.0d0) end if code = tmp end function
public static double code(double x) { double tmp; if (x <= -1e-308) { tmp = Math.sqrt(-x) / (x - 2.0); } else { tmp = ((-0.5 - (0.125 / x)) + x) / (x - 2.0); } return tmp; }
def code(x): tmp = 0 if x <= -1e-308: tmp = math.sqrt(-x) / (x - 2.0) else: tmp = ((-0.5 - (0.125 / x)) + x) / (x - 2.0) return tmp
function code(x) tmp = 0.0 if (x <= -1e-308) tmp = Float64(sqrt(Float64(-x)) / Float64(x - 2.0)); else tmp = Float64(Float64(Float64(-0.5 - Float64(0.125 / x)) + x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1e-308) tmp = sqrt(-x) / (x - 2.0); else tmp = ((-0.5 - (0.125 / x)) + x) / (x - 2.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1e-308], N[(N[Sqrt[(-x)], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 - N[(0.125 / x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-308}:\\ \;\;\;\;\frac{\sqrt{-x}}{x - 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-0.5 - \frac{0.125}{x}\right) + x}{x - 2}\\ \end{array} \end{array}
if x < -9.9999999999999991e-309
Initial program 99.9%
Taylor expanded in x around 0
mul-1-neg
N/A
lower-neg.f64
94.4
Applied rewrites94.4%
if -9.9999999999999991e-309 < x
Initial program 99.2%
Taylor expanded in x around inf
+-commutative
N/A
distribute-rgt-in
N/A
*-lft-identity
N/A
lower-+.f64
N/A
associate-*r/
N/A
associate-*l/
N/A
associate-/l*
N/A
*-rgt-identity
N/A
associate-*r/
N/A
rgt-mult-inverse
N/A
*-rgt-identity
N/A
distribute-lft-in
N/A
metadata-eval
N/A
mul-1-neg
N/A
unsub-neg
N/A
lower--.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
86.2
Applied rewrites86.2%
(FPCore (x) :precision binary64 (if (<= x -1e-308) (/ (sqrt (- x)) (- x 2.0)) (/ (+ -0.5 x) (- x 2.0))))
double code(double x) { double tmp; if (x <= -1e-308) { tmp = sqrt(-x) / (x - 2.0); } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
real(8) function code(x) real(8), intent (in) :: x real(8) :: tmp if (x <= (-1d-308)) then tmp = sqrt(-x) / (x - 2.0d0) else tmp = ((-0.5d0) + x) / (x - 2.0d0) end if code = tmp end function
public static double code(double x) { double tmp; if (x <= -1e-308) { tmp = Math.sqrt(-x) / (x - 2.0); } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
def code(x): tmp = 0 if x <= -1e-308: tmp = math.sqrt(-x) / (x - 2.0) else: tmp = (-0.5 + x) / (x - 2.0) return tmp
function code(x) tmp = 0.0 if (x <= -1e-308) tmp = Float64(sqrt(Float64(-x)) / Float64(x - 2.0)); else tmp = Float64(Float64(-0.5 + x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1e-308) tmp = sqrt(-x) / (x - 2.0); else tmp = (-0.5 + x) / (x - 2.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1e-308], N[(N[Sqrt[(-x)], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 + x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-308}:\\ \;\;\;\;\frac{\sqrt{-x}}{x - 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 + x}{x - 2}\\ \end{array} \end{array}
if x < -9.9999999999999991e-309
Initial program 99.9%
Taylor expanded in x around 0
mul-1-neg
N/A
lower-neg.f64
94.4
Applied rewrites94.4%
if -9.9999999999999991e-309 < x
Initial program 99.2%
Taylor expanded in x around inf
sub-neg
N/A
+-commutative
N/A
distribute-rgt-in
N/A
distribute-lft-neg-in
N/A
metadata-eval
N/A
associate-*l*
N/A
lft-mult-inverse
N/A
metadata-eval
N/A
*-lft-identity
N/A
lower-+.f64
76.5
Applied rewrites76.5%
(FPCore (x) :precision binary64 (/ (sqrt (- (* x x) x)) (- x 2.0)))
double code(double x) { return sqrt(((x * x) - x)) / (x - 2.0); }
real(8) function code(x) real(8), intent (in) :: x code = sqrt(((x * x) - x)) / (x - 2.0d0) end function
public static double code(double x) { return Math.sqrt(((x * x) - x)) / (x - 2.0); }
def code(x): return math.sqrt(((x * x) - x)) / (x - 2.0)
function code(x) return Float64(sqrt(Float64(Float64(x * x) - x)) / Float64(x - 2.0)) end
function tmp = code(x) tmp = sqrt(((x * x) - x)) / (x - 2.0); end
code[x_] := N[(N[Sqrt[N[(N[(x * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\sqrt{x \cdot x - x}}{x - 2} \end{array}
Initial program 99.9%
lift-*.f64
N/A
lift--.f64
N/A
distribute-lft-out--
N/A
*-rgt-identity
N/A
lower--.f64
N/A
lower-*.f64
99.9
Applied rewrites99.9%
(FPCore (x) :precision binary64 (/ (sqrt (* x (- x 1.0))) (- x 2.0)))
double code(double x) { return sqrt((x * (x - 1.0))) / (x - 2.0); }
real(8) function code(x) real(8), intent (in) :: x code = sqrt((x * (x - 1.0d0))) / (x - 2.0d0) end function
public static double code(double x) { return Math.sqrt((x * (x - 1.0))) / (x - 2.0); }
def code(x): return math.sqrt((x * (x - 1.0))) / (x - 2.0)
function code(x) return Float64(sqrt(Float64(x * Float64(x - 1.0))) / Float64(x - 2.0)) end
function tmp = code(x) tmp = sqrt((x * (x - 1.0))) / (x - 2.0); end
code[x_] := N[(N[Sqrt[N[(x * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{\sqrt{x \cdot \left(x - 1\right)}}{x - 2} \end{array}
Initial program 99.9%
(FPCore (x) :precision binary64 (if (<= x -1e-308) (/ (- 0.5 x) (- x 2.0)) (/ (+ -0.5 x) (- x 2.0))))
double code(double x) { double tmp; if (x <= -1e-308) { tmp = (0.5 - x) / (x - 2.0); } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
real(8) function code(x) real(8), intent (in) :: x real(8) :: tmp if (x <= (-1d-308)) then tmp = (0.5d0 - x) / (x - 2.0d0) else tmp = ((-0.5d0) + x) / (x - 2.0d0) end if code = tmp end function
public static double code(double x) { double tmp; if (x <= -1e-308) { tmp = (0.5 - x) / (x - 2.0); } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
def code(x): tmp = 0 if x <= -1e-308: tmp = (0.5 - x) / (x - 2.0) else: tmp = (-0.5 + x) / (x - 2.0) return tmp
function code(x) tmp = 0.0 if (x <= -1e-308) tmp = Float64(Float64(0.5 - x) / Float64(x - 2.0)); else tmp = Float64(Float64(-0.5 + x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1e-308) tmp = (0.5 - x) / (x - 2.0); else tmp = (-0.5 + x) / (x - 2.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1e-308], N[(N[(0.5 - x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 + x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-308}:\\ \;\;\;\;\frac{0.5 - x}{x - 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 + x}{x - 2}\\ \end{array} \end{array}
if x < -9.9999999999999991e-309
Initial program 99.9%
Taylor expanded in x around -inf
mul-1-neg
N/A
neg-sub0
N/A
sub-neg
N/A
+-commutative
N/A
distribute-rgt-in
N/A
distribute-lft-neg-in
N/A
metadata-eval
N/A
associate-*l*
N/A
lft-mult-inverse
N/A
metadata-eval
N/A
*-lft-identity
N/A
associate--r+
N/A
metadata-eval
N/A
lower--.f64
8.8
Applied rewrites8.8%
if -9.9999999999999991e-309 < x
Initial program 99.2%
Taylor expanded in x around inf
sub-neg
N/A
+-commutative
N/A
distribute-rgt-in
N/A
distribute-lft-neg-in
N/A
metadata-eval
N/A
associate-*l*
N/A
lft-mult-inverse
N/A
metadata-eval
N/A
*-lft-identity
N/A
lower-+.f64
76.5
Applied rewrites76.5%
(FPCore (x) :precision binary64 (if (<= x -1e-308) -1.0 (/ (+ -0.5 x) (- x 2.0))))
double code(double x) { double tmp; if (x <= -1e-308) { tmp = -1.0; } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
real(8) function code(x) real(8), intent (in) :: x real(8) :: tmp if (x <= (-1d-308)) then tmp = -1.0d0 else tmp = ((-0.5d0) + x) / (x - 2.0d0) end if code = tmp end function
public static double code(double x) { double tmp; if (x <= -1e-308) { tmp = -1.0; } else { tmp = (-0.5 + x) / (x - 2.0); } return tmp; }
def code(x): tmp = 0 if x <= -1e-308: tmp = -1.0 else: tmp = (-0.5 + x) / (x - 2.0) return tmp
function code(x) tmp = 0.0 if (x <= -1e-308) tmp = -1.0; else tmp = Float64(Float64(-0.5 + x) / Float64(x - 2.0)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= -1e-308) tmp = -1.0; else tmp = (-0.5 + x) / (x - 2.0); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, -1e-308], -1.0, N[(N[(-0.5 + x), $MachinePrecision] / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-308}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 + x}{x - 2}\\ \end{array} \end{array}
if x < -9.9999999999999991e-309
Initial program 99.9%
Taylor expanded in x around -inf
sub-neg
N/A
metadata-eval
N/A
+-commutative
N/A
mul-1-neg
N/A
unsub-neg
N/A
lower--.f64
N/A
lower-/.f64
N/A
+-commutative
N/A
lower-+.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
5.7
Applied rewrites5.7%
Taylor expanded in x around inf
Applied rewrites8.0%
if -9.9999999999999991e-309 < x
Initial program 99.2%
Taylor expanded in x around inf
sub-neg
N/A
+-commutative
N/A
distribute-rgt-in
N/A
distribute-lft-neg-in
N/A
metadata-eval
N/A
associate-*l*
N/A
lft-mult-inverse
N/A
metadata-eval
N/A
*-lft-identity
N/A
lower-+.f64
76.5
Applied rewrites76.5%
(FPCore (x) :precision binary64 (if (<= x 2.0) -1.0 (+ (/ 1.5 x) 1.0)))
double code(double x) { double tmp; if (x <= 2.0) { tmp = -1.0; } else { tmp = (1.5 / x) + 1.0; } return tmp; }
real(8) function code(x) real(8), intent (in) :: x real(8) :: tmp if (x <= 2.0d0) then tmp = -1.0d0 else tmp = (1.5d0 / x) + 1.0d0 end if code = tmp end function
public static double code(double x) { double tmp; if (x <= 2.0) { tmp = -1.0; } else { tmp = (1.5 / x) + 1.0; } return tmp; }
def code(x): tmp = 0 if x <= 2.0: tmp = -1.0 else: tmp = (1.5 / x) + 1.0 return tmp
function code(x) tmp = 0.0 if (x <= 2.0) tmp = -1.0; else tmp = Float64(Float64(1.5 / x) + 1.0); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 2.0) tmp = -1.0; else tmp = (1.5 / x) + 1.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 2.0], -1.0, N[(N[(1.5 / x), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;\frac{1.5}{x} + 1\\ \end{array} \end{array}
if x < 2
Initial program 99.9%
Taylor expanded in x around -inf
sub-neg
N/A
metadata-eval
N/A
+-commutative
N/A
mul-1-neg
N/A
unsub-neg
N/A
lower--.f64
N/A
lower-/.f64
N/A
+-commutative
N/A
lower-+.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
5.7
Applied rewrites5.7%
Taylor expanded in x around inf
Applied rewrites8.1%
if 2 < x
Initial program 99.3%
Taylor expanded in x around inf
+-commutative
N/A
lower-+.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
78.3
Applied rewrites78.3%
(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 99.9%
Taylor expanded in x around -inf
sub-neg
N/A
metadata-eval
N/A
+-commutative
N/A
mul-1-neg
N/A
unsub-neg
N/A
lower--.f64
N/A
lower-/.f64
N/A
+-commutative
N/A
lower-+.f64
N/A
associate-*r/
N/A
metadata-eval
N/A
lower-/.f64
5.6
Applied rewrites5.6%
Taylor expanded in x around inf
Applied rewrites7.9%
(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 99.9%
Taylor expanded in x around inf
Applied rewrites3.1%
herbie shell --seed 1
(FPCore (x)
:name "sqrt(x*(x-1))/(x-2)"
:precision binary64
:pre (and (<= -10000000000.0 x) (<= x 10000000000.0))
(/ (sqrt (* x (- x 1.0))) (- x 2.0)))