
(FPCore (x y) :precision binary64 -0.8273960599468214)
double code(double x, double y) {
return -0.8273960599468214;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -0.8273960599468214d0
end function
public static double code(double x, double y) {
return -0.8273960599468214;
}
def code(x, y): return -0.8273960599468214
function code(x, y) return -0.8273960599468214 end
function tmp = code(x, y) tmp = -0.8273960599468214; end
code[x_, y_] := -0.8273960599468214
\begin{array}{l}
\\
-0.8273960599468214
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 4 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y)
:precision binary64
(+
(+
(+
(* 333.75 (pow y 6.0))
(*
(* x x)
(-
(- (- (* (* (* (* 11.0 x) x) y) y) (pow y 6.0)) (* 121.0 (pow y 4.0)))
2.0)))
(* 5.5 (pow y 8.0)))
(/ x (* 2.0 y))))
double code(double x, double y) {
return (((333.75 * pow(y, 6.0)) + ((x * x) * (((((((11.0 * x) * x) * y) * y) - pow(y, 6.0)) - (121.0 * pow(y, 4.0))) - 2.0))) + (5.5 * pow(y, 8.0))) + (x / (2.0 * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (((333.75d0 * (y ** 6.0d0)) + ((x * x) * (((((((11.0d0 * x) * x) * y) * y) - (y ** 6.0d0)) - (121.0d0 * (y ** 4.0d0))) - 2.0d0))) + (5.5d0 * (y ** 8.0d0))) + (x / (2.0d0 * y))
end function
public static double code(double x, double y) {
return (((333.75 * Math.pow(y, 6.0)) + ((x * x) * (((((((11.0 * x) * x) * y) * y) - Math.pow(y, 6.0)) - (121.0 * Math.pow(y, 4.0))) - 2.0))) + (5.5 * Math.pow(y, 8.0))) + (x / (2.0 * y));
}
def code(x, y): return (((333.75 * math.pow(y, 6.0)) + ((x * x) * (((((((11.0 * x) * x) * y) * y) - math.pow(y, 6.0)) - (121.0 * math.pow(y, 4.0))) - 2.0))) + (5.5 * math.pow(y, 8.0))) + (x / (2.0 * y))
function code(x, y) return Float64(Float64(Float64(Float64(333.75 * (y ^ 6.0)) + Float64(Float64(x * x) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(11.0 * x) * x) * y) * y) - (y ^ 6.0)) - Float64(121.0 * (y ^ 4.0))) - 2.0))) + Float64(5.5 * (y ^ 8.0))) + Float64(x / Float64(2.0 * y))) end
function tmp = code(x, y) tmp = (((333.75 * (y ^ 6.0)) + ((x * x) * (((((((11.0 * x) * x) * y) * y) - (y ^ 6.0)) - (121.0 * (y ^ 4.0))) - 2.0))) + (5.5 * (y ^ 8.0))) + (x / (2.0 * y)); end
code[x_, y_] := N[(N[(N[(N[(333.75 * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(11.0 * x), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] - N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] - N[(121.0 * N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(5.5 * N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (pow (exp 6.0) (* (log y) 0.5)))) (+ (+ (* (- 333.75 x) (pow y 6.0)) (* t_0 (* t_0 5.5))) (/ x (* 2.0 y)))))
double code(double x, double y) {
double t_0 = pow(exp(6.0), (log(y) * 0.5));
return (((333.75 - x) * pow(y, 6.0)) + (t_0 * (t_0 * 5.5))) + (x / (2.0 * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = exp(6.0d0) ** (log(y) * 0.5d0)
code = (((333.75d0 - x) * (y ** 6.0d0)) + (t_0 * (t_0 * 5.5d0))) + (x / (2.0d0 * y))
end function
public static double code(double x, double y) {
double t_0 = Math.pow(Math.exp(6.0), (Math.log(y) * 0.5));
return (((333.75 - x) * Math.pow(y, 6.0)) + (t_0 * (t_0 * 5.5))) + (x / (2.0 * y));
}
def code(x, y): t_0 = math.pow(math.exp(6.0), (math.log(y) * 0.5)) return (((333.75 - x) * math.pow(y, 6.0)) + (t_0 * (t_0 * 5.5))) + (x / (2.0 * y))
function code(x, y) t_0 = exp(6.0) ^ Float64(log(y) * 0.5) return Float64(Float64(Float64(Float64(333.75 - x) * (y ^ 6.0)) + Float64(t_0 * Float64(t_0 * 5.5))) + Float64(x / Float64(2.0 * y))) end
function tmp = code(x, y) t_0 = exp(6.0) ^ (log(y) * 0.5); tmp = (((333.75 - x) * (y ^ 6.0)) + (t_0 * (t_0 * 5.5))) + (x / (2.0 * y)); end
code[x_, y_] := Block[{t$95$0 = N[Power[N[Exp[6.0], $MachinePrecision], N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(333.75 - x), $MachinePrecision] * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(t$95$0 * 5.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(e^{6}\right)}^{\left(\log y \cdot 0.5\right)}\\
\left(\left(333.75 - x\right) \cdot {y}^{6} + t\_0 \cdot \left(t\_0 \cdot 5.5\right)\right) + \frac{x}{2 \cdot y}
\end{array}
\end{array}
Initial program 9.2%
lift-*.f64N/A
lift-pow.f64N/A
sqr-powN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Applied rewrites7.9%
Applied rewrites8.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-pow.f648.2
Applied rewrites8.2%
(FPCore (x y)
:precision binary64
(+
(+
(+
(* 333.75 (pow y 6.0))
(*
x
(-
(-
(- (* (* (* (* 11.0 x) x) y) y) (pow y 6.0))
(* (* (* y y) 121.0) (* y y)))
2.0)))
(* (pow (exp 6.0) (* (log y) 0.5)) (* (* (* y y) y) 5.5)))
(/ x (* 2.0 y))))
double code(double x, double y) {
return (((333.75 * pow(y, 6.0)) + (x * (((((((11.0 * x) * x) * y) * y) - pow(y, 6.0)) - (((y * y) * 121.0) * (y * y))) - 2.0))) + (pow(exp(6.0), (log(y) * 0.5)) * (((y * y) * y) * 5.5))) + (x / (2.0 * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (((333.75d0 * (y ** 6.0d0)) + (x * (((((((11.0d0 * x) * x) * y) * y) - (y ** 6.0d0)) - (((y * y) * 121.0d0) * (y * y))) - 2.0d0))) + ((exp(6.0d0) ** (log(y) * 0.5d0)) * (((y * y) * y) * 5.5d0))) + (x / (2.0d0 * y))
end function
public static double code(double x, double y) {
return (((333.75 * Math.pow(y, 6.0)) + (x * (((((((11.0 * x) * x) * y) * y) - Math.pow(y, 6.0)) - (((y * y) * 121.0) * (y * y))) - 2.0))) + (Math.pow(Math.exp(6.0), (Math.log(y) * 0.5)) * (((y * y) * y) * 5.5))) + (x / (2.0 * y));
}
def code(x, y): return (((333.75 * math.pow(y, 6.0)) + (x * (((((((11.0 * x) * x) * y) * y) - math.pow(y, 6.0)) - (((y * y) * 121.0) * (y * y))) - 2.0))) + (math.pow(math.exp(6.0), (math.log(y) * 0.5)) * (((y * y) * y) * 5.5))) + (x / (2.0 * y))
function code(x, y) return Float64(Float64(Float64(Float64(333.75 * (y ^ 6.0)) + Float64(x * Float64(Float64(Float64(Float64(Float64(Float64(Float64(11.0 * x) * x) * y) * y) - (y ^ 6.0)) - Float64(Float64(Float64(y * y) * 121.0) * Float64(y * y))) - 2.0))) + Float64((exp(6.0) ^ Float64(log(y) * 0.5)) * Float64(Float64(Float64(y * y) * y) * 5.5))) + Float64(x / Float64(2.0 * y))) end
function tmp = code(x, y) tmp = (((333.75 * (y ^ 6.0)) + (x * (((((((11.0 * x) * x) * y) * y) - (y ^ 6.0)) - (((y * y) * 121.0) * (y * y))) - 2.0))) + ((exp(6.0) ^ (log(y) * 0.5)) * (((y * y) * y) * 5.5))) + (x / (2.0 * y)); end
code[x_, y_] := N[(N[(N[(N[(333.75 * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(N[(N[(N[(N[(N[(11.0 * x), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] - N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(y * y), $MachinePrecision] * 121.0), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Exp[6.0], $MachinePrecision], N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 5.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(333.75 \cdot {y}^{6} + x \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - \left(\left(y \cdot y\right) \cdot 121\right) \cdot \left(y \cdot y\right)\right) - 2\right)\right) + {\left(e^{6}\right)}^{\left(\log y \cdot 0.5\right)} \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 5.5\right)\right) + \frac{x}{2 \cdot y}
\end{array}
Initial program 9.2%
lift-*.f64N/A
lift-pow.f64N/A
sqr-powN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Applied rewrites7.9%
Applied rewrites8.2%
lift-pow.f64N/A
lift-*.f64N/A
pow-unpowN/A
lift-exp.f64N/A
pow-expN/A
*-commutativeN/A
lift-log.f64N/A
pow-to-expN/A
pow-powN/A
metadata-evalN/A
unpow3N/A
lift-*.f64N/A
lower-*.f648.2
Applied rewrites8.2%
(FPCore (x y) :precision binary64 (+ (+ (* (- 333.75 x) (pow y 6.0)) (* y 5.5)) (/ x (* 2.0 y))))
double code(double x, double y) {
return (((333.75 - x) * pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (((333.75d0 - x) * (y ** 6.0d0)) + (y * 5.5d0)) + (x / (2.0d0 * y))
end function
public static double code(double x, double y) {
return (((333.75 - x) * Math.pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y));
}
def code(x, y): return (((333.75 - x) * math.pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y))
function code(x, y) return Float64(Float64(Float64(Float64(333.75 - x) * (y ^ 6.0)) + Float64(y * 5.5)) + Float64(x / Float64(2.0 * y))) end
function tmp = code(x, y) tmp = (((333.75 - x) * (y ^ 6.0)) + (y * 5.5)) + (x / (2.0 * y)); end
code[x_, y_] := N[(N[(N[(N[(333.75 - x), $MachinePrecision] * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] + N[(y * 5.5), $MachinePrecision]), $MachinePrecision] + N[(x / N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(333.75 - x\right) \cdot {y}^{6} + y \cdot 5.5\right) + \frac{x}{2 \cdot y}
\end{array}
Initial program 9.2%
lift-*.f64N/A
lift-pow.f64N/A
sqr-powN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Applied rewrites7.9%
Applied rewrites8.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-pow.f648.2
Applied rewrites8.2%
(FPCore (x y) :precision binary64 (+ (+ (* 333.75 (pow y 6.0)) (* y 5.5)) (/ x (* 2.0 y))))
double code(double x, double y) {
return ((333.75 * pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((333.75d0 * (y ** 6.0d0)) + (y * 5.5d0)) + (x / (2.0d0 * y))
end function
public static double code(double x, double y) {
return ((333.75 * Math.pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y));
}
def code(x, y): return ((333.75 * math.pow(y, 6.0)) + (y * 5.5)) + (x / (2.0 * y))
function code(x, y) return Float64(Float64(Float64(333.75 * (y ^ 6.0)) + Float64(y * 5.5)) + Float64(x / Float64(2.0 * y))) end
function tmp = code(x, y) tmp = ((333.75 * (y ^ 6.0)) + (y * 5.5)) + (x / (2.0 * y)); end
code[x_, y_] := N[(N[(N[(333.75 * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision] + N[(y * 5.5), $MachinePrecision]), $MachinePrecision] + N[(x / N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(333.75 \cdot {y}^{6} + y \cdot 5.5\right) + \frac{x}{2 \cdot y}
\end{array}
Initial program 9.2%
lift-*.f64N/A
lift-pow.f64N/A
sqr-powN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Applied rewrites7.9%
Applied rewrites8.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-pow.f641.5
Applied rewrites1.5%
herbie shell --seed 2024298
(FPCore (x y)
:name "Rump's expression from Stadtherr's award speech"
:precision binary64
:pre (and (== x 77617.0) (== y 33096.0))
(+ (+ (+ (* 333.75 (pow y 6.0)) (* (* x x) (- (- (- (* (* (* (* 11.0 x) x) y) y) (pow y 6.0)) (* 121.0 (pow y 4.0))) 2.0))) (* 5.5 (pow y 8.0))) (/ x (* 2.0 y))))