
(FPCore (a b) :precision binary64 (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ 3.0 a))))) 1.0))
double code(double a, double b) {
return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 - a)) + ((b * b) * (3.0d0 + a))))) - 1.0d0
end function
public static double code(double a, double b) {
return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0;
}
def code(a, b): return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0
function code(a, b) return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(3.0 + a))))) - 1.0) end
function tmp = code(a, b) tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0; end
code[a_, b_] := N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(3.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ 3.0 a))))) 1.0))
double code(double a, double b) {
return (pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((a * a) + (b * b)) ** 2.0d0) + (4.0d0 * (((a * a) * (1.0d0 - a)) + ((b * b) * (3.0d0 + a))))) - 1.0d0
end function
public static double code(double a, double b) {
return (Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0;
}
def code(a, b): return (math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0
function code(a, b) return Float64(Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(3.0 + a))))) - 1.0) end
function tmp = code(a, b) tmp = ((((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (3.0 + a))))) - 1.0; end
code[a_, b_] := N[(N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(3.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(3 + a\right)\right)\right) - 1
\end{array}
(FPCore (a b)
:precision binary64
(let* ((t_0 (fma b b (* a a))) (t_1 (fma a a (* b b))))
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
2e+62)
(+
(fma
(- 1.0 a)
(* (* a a) 4.0)
(fma b (* 4.0 (* b (+ a 3.0))) (* t_1 t_1)))
-1.0)
(fma t_0 t_0 (fma (* b b) 12.0 -1.0)))))
double code(double a, double b) {
double t_0 = fma(b, b, (a * a));
double t_1 = fma(a, a, (b * b));
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= 2e+62) {
tmp = fma((1.0 - a), ((a * a) * 4.0), fma(b, (4.0 * (b * (a + 3.0))), (t_1 * t_1))) + -1.0;
} else {
tmp = fma(t_0, t_0, fma((b * b), 12.0, -1.0));
}
return tmp;
}
function code(a, b) t_0 = fma(b, b, Float64(a * a)) t_1 = fma(a, a, Float64(b * b)) tmp = 0.0 if (Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) <= 2e+62) tmp = Float64(fma(Float64(1.0 - a), Float64(Float64(a * a) * 4.0), fma(b, Float64(4.0 * Float64(b * Float64(a + 3.0))), Float64(t_1 * t_1))) + -1.0); else tmp = fma(t_0, t_0, fma(Float64(b * b), 12.0, -1.0)); end return tmp end
code[a_, b_] := Block[{t$95$0 = N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(a * a + N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+62], N[(N[(N[(1.0 - a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + N[(b * N[(4.0 * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, a \cdot a\right)\\
t_1 := \mathsf{fma}\left(a, a, b \cdot b\right)\\
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(1 - a, \left(a \cdot a\right) \cdot 4, \mathsf{fma}\left(b, 4 \cdot \left(b \cdot \left(a + 3\right)\right), t\_1 \cdot t\_1\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < 2.00000000000000007e62Initial program 99.8%
Applied egg-rr99.8%
if 2.00000000000000007e62 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 67.3%
Applied egg-rr68.9%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Simplified99.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
remove-double-div99.9
lift-fma.f64N/A
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (a b)
:precision binary64
(let* ((t_0 (fma a a (* b b))) (t_1 (fma b b (* a a))))
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
2e+62)
(fma (fma a (* a (- 1.0 a)) (* b (* b (+ a 3.0)))) 4.0 (fma t_0 t_0 -1.0))
(fma t_1 t_1 (fma (* b b) 12.0 -1.0)))))
double code(double a, double b) {
double t_0 = fma(a, a, (b * b));
double t_1 = fma(b, b, (a * a));
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= 2e+62) {
tmp = fma(fma(a, (a * (1.0 - a)), (b * (b * (a + 3.0)))), 4.0, fma(t_0, t_0, -1.0));
} else {
tmp = fma(t_1, t_1, fma((b * b), 12.0, -1.0));
}
return tmp;
}
function code(a, b) t_0 = fma(a, a, Float64(b * b)) t_1 = fma(b, b, Float64(a * a)) tmp = 0.0 if (Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) <= 2e+62) tmp = fma(fma(a, Float64(a * Float64(1.0 - a)), Float64(b * Float64(b * Float64(a + 3.0)))), 4.0, fma(t_0, t_0, -1.0)); else tmp = fma(t_1, t_1, fma(Float64(b * b), 12.0, -1.0)); end return tmp end
code[a_, b_] := Block[{t$95$0 = N[(a * a + N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+62], N[(N[(a * N[(a * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 4.0 + N[(t$95$0 * t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$1 + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, a, b \cdot b\right)\\
t_1 := \mathsf{fma}\left(b, b, a \cdot a\right)\\
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \left(1 - a\right), b \cdot \left(b \cdot \left(a + 3\right)\right)\right), 4, \mathsf{fma}\left(t\_0, t\_0, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < 2.00000000000000007e62Initial program 99.8%
Applied egg-rr99.8%
if 2.00000000000000007e62 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 67.3%
Applied egg-rr68.9%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Simplified99.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
remove-double-div99.9
lift-fma.f64N/A
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (a b)
:precision binary64
(let* ((t_0 (fma b b (* a a))))
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
2e+38)
(fma
(fma a (* a (- 1.0 a)) (* b (* b (+ a 3.0))))
4.0
(fma (* a a) (* a a) -1.0))
(fma t_0 t_0 (fma (* b b) 12.0 -1.0)))))
double code(double a, double b) {
double t_0 = fma(b, b, (a * a));
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= 2e+38) {
tmp = fma(fma(a, (a * (1.0 - a)), (b * (b * (a + 3.0)))), 4.0, fma((a * a), (a * a), -1.0));
} else {
tmp = fma(t_0, t_0, fma((b * b), 12.0, -1.0));
}
return tmp;
}
function code(a, b) t_0 = fma(b, b, Float64(a * a)) tmp = 0.0 if (Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) <= 2e+38) tmp = fma(fma(a, Float64(a * Float64(1.0 - a)), Float64(b * Float64(b * Float64(a + 3.0)))), 4.0, fma(Float64(a * a), Float64(a * a), -1.0)); else tmp = fma(t_0, t_0, fma(Float64(b * b), 12.0, -1.0)); end return tmp end
code[a_, b_] := Block[{t$95$0 = N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+38], N[(N[(a * N[(a * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 4.0 + N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, a \cdot a\right)\\
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \left(1 - a\right), b \cdot \left(b \cdot \left(a + 3\right)\right)\right), 4, \mathsf{fma}\left(a \cdot a, a \cdot a, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < 1.99999999999999995e38Initial program 99.9%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Simplified99.9%
Applied egg-rr99.9%
if 1.99999999999999995e38 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 68.3%
Applied egg-rr69.9%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.7
Simplified99.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
remove-double-div99.7
lift-fma.f64N/A
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (a b)
:precision binary64
(let* ((t_0 (fma b b (* a a))))
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
2e+38)
(fma
(* a (* a a))
a
(fma 4.0 (fma a (* a (- 1.0 a)) (* b (* b (+ a 3.0)))) -1.0))
(fma t_0 t_0 (fma (* b b) 12.0 -1.0)))))
double code(double a, double b) {
double t_0 = fma(b, b, (a * a));
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= 2e+38) {
tmp = fma((a * (a * a)), a, fma(4.0, fma(a, (a * (1.0 - a)), (b * (b * (a + 3.0)))), -1.0));
} else {
tmp = fma(t_0, t_0, fma((b * b), 12.0, -1.0));
}
return tmp;
}
function code(a, b) t_0 = fma(b, b, Float64(a * a)) tmp = 0.0 if (Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) <= 2e+38) tmp = fma(Float64(a * Float64(a * a)), a, fma(4.0, fma(a, Float64(a * Float64(1.0 - a)), Float64(b * Float64(b * Float64(a + 3.0)))), -1.0)); else tmp = fma(t_0, t_0, fma(Float64(b * b), 12.0, -1.0)); end return tmp end
code[a_, b_] := Block[{t$95$0 = N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+38], N[(N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] * a + N[(4.0 * N[(a * N[(a * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, a \cdot a\right)\\
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot \left(a \cdot a\right), a, \mathsf{fma}\left(4, \mathsf{fma}\left(a, a \cdot \left(1 - a\right), b \cdot \left(b \cdot \left(a + 3\right)\right)\right), -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < 1.99999999999999995e38Initial program 99.9%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Simplified99.9%
Applied egg-rr99.9%
if 1.99999999999999995e38 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 68.3%
Applied egg-rr69.9%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.7
Simplified99.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
remove-double-div99.7
lift-fma.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (a b)
:precision binary64
(let* ((t_0 (fma b b (* a a))))
(if (<=
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))
2e+38)
(+ (+ (* a (* a (* a a))) (* 4.0 (* a (fma a (- a) a)))) -1.0)
(fma t_0 t_0 (fma (* b b) 12.0 -1.0)))))
double code(double a, double b) {
double t_0 = fma(b, b, (a * a));
double tmp;
if ((pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))))) <= 2e+38) {
tmp = ((a * (a * (a * a))) + (4.0 * (a * fma(a, -a, a)))) + -1.0;
} else {
tmp = fma(t_0, t_0, fma((b * b), 12.0, -1.0));
}
return tmp;
}
function code(a, b) t_0 = fma(b, b, Float64(a * a)) tmp = 0.0 if (Float64((Float64(Float64(a * a) + Float64(b * b)) ^ 2.0) + Float64(4.0 * Float64(Float64(Float64(a * a) * Float64(1.0 - a)) + Float64(Float64(b * b) * Float64(a + 3.0))))) <= 2e+38) tmp = Float64(Float64(Float64(a * Float64(a * Float64(a * a))) + Float64(4.0 * Float64(a * fma(a, Float64(-a), a)))) + -1.0); else tmp = fma(t_0, t_0, fma(Float64(b * b), 12.0, -1.0)); end return tmp end
code[a_, b_] := Block[{t$95$0 = N[(b * b + N[(a * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(N[(N[(a * a), $MachinePrecision] * N[(1.0 - a), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+38], N[(N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(a * N[(a * (-a) + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(b, b, a \cdot a\right)\\
\mathbf{if}\;{\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 - a\right) + \left(b \cdot b\right) \cdot \left(a + 3\right)\right) \leq 2 \cdot 10^{+38}:\\
\;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right) + 4 \cdot \left(a \cdot \mathsf{fma}\left(a, -a, a\right)\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) < 1.99999999999999995e38Initial program 99.9%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Simplified99.9%
Taylor expanded in b around 0
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
unpow2N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
mul-1-negN/A
distribute-rgt-inN/A
*-rgt-identityN/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
distribute-lft-inN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6499.6
Simplified99.6%
if 1.99999999999999995e38 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) #s(literal 2 binary64)) (*.f64 #s(literal 4 binary64) (+.f64 (*.f64 (*.f64 a a) (-.f64 #s(literal 1 binary64) a)) (*.f64 (*.f64 b b) (+.f64 #s(literal 3 binary64) a))))) Initial program 68.3%
Applied egg-rr69.9%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.7
Simplified99.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
remove-double-div99.7
lift-fma.f64N/A
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (a b)
:precision binary64
(if (<= a -1.45)
(fma (* a a) (* a a) (* 12.0 (* b (* b b))))
(if (<= a 7.7e-31)
(+ (+ (* (* b b) (* b b)) (* 4.0 (* (* b b) 3.0))) -1.0)
(+ (+ (* b b) (* a (* a (* a a)))) -1.0))))
double code(double a, double b) {
double tmp;
if (a <= -1.45) {
tmp = fma((a * a), (a * a), (12.0 * (b * (b * b))));
} else if (a <= 7.7e-31) {
tmp = (((b * b) * (b * b)) + (4.0 * ((b * b) * 3.0))) + -1.0;
} else {
tmp = ((b * b) + (a * (a * (a * a)))) + -1.0;
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= -1.45) tmp = fma(Float64(a * a), Float64(a * a), Float64(12.0 * Float64(b * Float64(b * b)))); elseif (a <= 7.7e-31) tmp = Float64(Float64(Float64(Float64(b * b) * Float64(b * b)) + Float64(4.0 * Float64(Float64(b * b) * 3.0))) + -1.0); else tmp = Float64(Float64(Float64(b * b) + Float64(a * Float64(a * Float64(a * a)))) + -1.0); end return tmp end
code[a_, b_] := If[LessEqual[a, -1.45], N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision] + N[(12.0 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.7e-31], N[(N[(N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, a \cdot a, 12 \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;a \leq 7.7 \cdot 10^{-31}:\\
\;\;\;\;\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right) + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b + a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) + -1\\
\end{array}
\end{array}
if a < -1.44999999999999996Initial program 65.1%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.1
Simplified61.1%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6493.5
Simplified93.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
Applied egg-rr93.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.9
Simplified80.9%
if -1.44999999999999996 < a < 7.70000000000000012e-31Initial program 99.9%
Taylor expanded in a around 0
associate-*r*N/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.6
Simplified99.6%
Taylor expanded in b around inf
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.6
Simplified99.6%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Simplified99.1%
if 7.70000000000000012e-31 < a Initial program 41.5%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6440.0
Simplified40.0%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6495.1
Simplified95.1%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6495.1
Simplified95.1%
Final simplification93.0%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+118) (+ (+ (* a (* a (* a a))) (* 4.0 (* (* b b) 3.0))) -1.0) (* (* b b) (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = ((a * (a * (a * a))) + (4.0 * ((b * b) * 3.0))) + -1.0;
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1d+118) then
tmp = ((a * (a * (a * a))) + (4.0d0 * ((b * b) * 3.0d0))) + (-1.0d0)
else
tmp = (b * b) * (b * (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = ((a * (a * (a * a))) + (4.0 * ((b * b) * 3.0))) + -1.0;
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e+118: tmp = ((a * (a * (a * a))) + (4.0 * ((b * b) * 3.0))) + -1.0 else: tmp = (b * b) * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+118) tmp = Float64(Float64(Float64(a * Float64(a * Float64(a * a))) + Float64(4.0 * Float64(Float64(b * b) * 3.0))) + -1.0); else tmp = Float64(Float64(b * b) * Float64(b * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1e+118) tmp = ((a * (a * (a * a))) + (4.0 * ((b * b) * 3.0))) + -1.0; else tmp = (b * b) * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+118], N[(N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{+118}:\\
\;\;\;\;\left(a \cdot \left(a \cdot \left(a \cdot a\right)\right) + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 9.99999999999999967e117Initial program 86.0%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.1
Simplified78.1%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
if 9.99999999999999967e117 < (*.f64 b b) Initial program 62.5%
Taylor expanded in b around inf
lower-pow.f6448.3
Simplified48.3%
metadata-evalN/A
pow-powN/A
pow3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6448.3
Applied egg-rr48.3%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6448.3
Simplified48.3%
Final simplification72.4%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+118) (fma (* a a) (* a a) (fma (* b b) 12.0 -1.0)) (* (* b b) (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = fma((a * a), (a * a), fma((b * b), 12.0, -1.0));
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+118) tmp = fma(Float64(a * a), Float64(a * a), fma(Float64(b * b), 12.0, -1.0)); else tmp = Float64(Float64(b * b) * Float64(b * Float64(b * b))); end return tmp end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+118], N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * 12.0 + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, a \cdot a, \mathsf{fma}\left(b \cdot b, 12, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 9.99999999999999967e117Initial program 86.0%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.1
Simplified78.1%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
Applied egg-rr88.9%
if 9.99999999999999967e117 < (*.f64 b b) Initial program 62.5%
Taylor expanded in b around inf
lower-pow.f6448.3
Simplified48.3%
metadata-evalN/A
pow-powN/A
pow3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6448.3
Applied egg-rr48.3%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6448.3
Simplified48.3%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+118) (+ (+ (* b b) (* a (* a (* a a)))) -1.0) (* (* b b) (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = ((b * b) + (a * (a * (a * a)))) + -1.0;
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1d+118) then
tmp = ((b * b) + (a * (a * (a * a)))) + (-1.0d0)
else
tmp = (b * b) * (b * (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = ((b * b) + (a * (a * (a * a)))) + -1.0;
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e+118: tmp = ((b * b) + (a * (a * (a * a)))) + -1.0 else: tmp = (b * b) * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+118) tmp = Float64(Float64(Float64(b * b) + Float64(a * Float64(a * Float64(a * a)))) + -1.0); else tmp = Float64(Float64(b * b) * Float64(b * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1e+118) tmp = ((b * b) + (a * (a * (a * a)))) + -1.0; else tmp = (b * b) * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+118], N[(N[(N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{+118}:\\
\;\;\;\;\left(b \cdot b + a \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 9.99999999999999967e117Initial program 86.0%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.1
Simplified78.1%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6488.8
Simplified88.8%
if 9.99999999999999967e117 < (*.f64 b b) Initial program 62.5%
Taylor expanded in b around inf
lower-pow.f6448.3
Simplified48.3%
metadata-evalN/A
pow-powN/A
pow3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6448.3
Applied egg-rr48.3%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6448.3
Simplified48.3%
Final simplification72.3%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+118) (fma (* a a) (* a a) -1.0) (* (* b b) (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+118) {
tmp = fma((a * a), (a * a), -1.0);
} else {
tmp = (b * b) * (b * (b * b));
}
return tmp;
}
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+118) tmp = fma(Float64(a * a), Float64(a * a), -1.0); else tmp = Float64(Float64(b * b) * Float64(b * Float64(b * b))); end return tmp end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+118], N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, a \cdot a, -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 9.99999999999999967e117Initial program 86.0%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.1
Simplified78.1%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6488.9
Simplified88.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
Applied egg-rr88.9%
Taylor expanded in b around 0
Simplified88.3%
if 9.99999999999999967e117 < (*.f64 b b) Initial program 62.5%
Taylor expanded in b around inf
lower-pow.f6448.3
Simplified48.3%
metadata-evalN/A
pow-powN/A
pow3N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f64N/A
cube-unmultN/A
lift-*.f64N/A
lower-*.f6448.3
Applied egg-rr48.3%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6448.3
Simplified48.3%
(FPCore (a b) :precision binary64 (if (<= (* b b) 3e+193) (fma (* a a) (* a a) -1.0) (* (* b (* b b)) 16.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 3e+193) {
tmp = fma((a * a), (a * a), -1.0);
} else {
tmp = (b * (b * b)) * 16.0;
}
return tmp;
}
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 3e+193) tmp = fma(Float64(a * a), Float64(a * a), -1.0); else tmp = Float64(Float64(b * Float64(b * b)) * 16.0); end return tmp end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 3e+193], N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision] * 16.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 3 \cdot 10^{+193}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, a \cdot a, -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \left(b \cdot b\right)\right) \cdot 16\\
\end{array}
\end{array}
if (*.f64 b b) < 3e193Initial program 83.1%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.0
Simplified73.0%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6487.0
Simplified87.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
Applied egg-rr87.0%
Taylor expanded in b around 0
Simplified86.4%
if 3e193 < (*.f64 b b) Initial program 64.0%
Taylor expanded in a around 0
associate-*r*N/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.0
Simplified64.0%
Taylor expanded in b around inf
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.0
Simplified64.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.4
Simplified49.4%
(FPCore (a b) :precision binary64 (if (<= a 52000.0) (fma 12.0 (* b (* b b)) -1.0) (* 4.0 (* b (* a b)))))
double code(double a, double b) {
double tmp;
if (a <= 52000.0) {
tmp = fma(12.0, (b * (b * b)), -1.0);
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
function code(a, b) tmp = 0.0 if (a <= 52000.0) tmp = fma(12.0, Float64(b * Float64(b * b)), -1.0); else tmp = Float64(4.0 * Float64(b * Float64(a * b))); end return tmp end
code[a_, b_] := If[LessEqual[a, 52000.0], N[(12.0 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(4.0 * N[(b * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 52000:\\
\;\;\;\;\mathsf{fma}\left(12, b \cdot \left(b \cdot b\right), -1\right)\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(b \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 52000Initial program 87.5%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.1
Simplified73.1%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6448.1
Simplified48.1%
if 52000 < a Initial program 36.2%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.6
Simplified34.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6419.4
Simplified19.4%
Taylor expanded in a around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.2
Simplified37.2%
Final simplification45.8%
(FPCore (a b) :precision binary64 (if (<= a 23000000.0) (* (* b (* b b)) 16.0) (* 4.0 (* b (* a b)))))
double code(double a, double b) {
double tmp;
if (a <= 23000000.0) {
tmp = (b * (b * b)) * 16.0;
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 23000000.0d0) then
tmp = (b * (b * b)) * 16.0d0
else
tmp = 4.0d0 * (b * (a * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= 23000000.0) {
tmp = (b * (b * b)) * 16.0;
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= 23000000.0: tmp = (b * (b * b)) * 16.0 else: tmp = 4.0 * (b * (a * b)) return tmp
function code(a, b) tmp = 0.0 if (a <= 23000000.0) tmp = Float64(Float64(b * Float64(b * b)) * 16.0); else tmp = Float64(4.0 * Float64(b * Float64(a * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= 23000000.0) tmp = (b * (b * b)) * 16.0; else tmp = 4.0 * (b * (a * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, 23000000.0], N[(N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision] * 16.0), $MachinePrecision], N[(4.0 * N[(b * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 23000000:\\
\;\;\;\;\left(b \cdot \left(b \cdot b\right)\right) \cdot 16\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(b \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 2.3e7Initial program 87.5%
Taylor expanded in a around 0
associate-*r*N/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-inN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.0
Simplified80.0%
Taylor expanded in b around inf
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6480.0
Simplified80.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6420.3
Simplified20.3%
if 2.3e7 < a Initial program 36.2%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.6
Simplified34.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6419.4
Simplified19.4%
Taylor expanded in a around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.2
Simplified37.2%
Final simplification24.0%
(FPCore (a b) :precision binary64 (if (<= a 23000000.0) (* 12.0 (* b (* b b))) (* 4.0 (* b (* a b)))))
double code(double a, double b) {
double tmp;
if (a <= 23000000.0) {
tmp = 12.0 * (b * (b * b));
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 23000000.0d0) then
tmp = 12.0d0 * (b * (b * b))
else
tmp = 4.0d0 * (b * (a * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= 23000000.0) {
tmp = 12.0 * (b * (b * b));
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= 23000000.0: tmp = 12.0 * (b * (b * b)) else: tmp = 4.0 * (b * (a * b)) return tmp
function code(a, b) tmp = 0.0 if (a <= 23000000.0) tmp = Float64(12.0 * Float64(b * Float64(b * b))); else tmp = Float64(4.0 * Float64(b * Float64(a * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= 23000000.0) tmp = 12.0 * (b * (b * b)); else tmp = 4.0 * (b * (a * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, 23000000.0], N[(12.0 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(b * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 23000000:\\
\;\;\;\;12 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(b \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 2.3e7Initial program 87.5%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.1
Simplified73.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6420.8
Simplified20.8%
Taylor expanded in a around 0
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6420.3
Simplified20.3%
if 2.3e7 < a Initial program 36.2%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.6
Simplified34.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6419.4
Simplified19.4%
Taylor expanded in a around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.2
Simplified37.2%
Final simplification24.0%
(FPCore (a b) :precision binary64 (if (<= a 7.7e-31) (* b (* b 12.0)) (* 4.0 (* b (* a b)))))
double code(double a, double b) {
double tmp;
if (a <= 7.7e-31) {
tmp = b * (b * 12.0);
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 7.7d-31) then
tmp = b * (b * 12.0d0)
else
tmp = 4.0d0 * (b * (a * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= 7.7e-31) {
tmp = b * (b * 12.0);
} else {
tmp = 4.0 * (b * (a * b));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= 7.7e-31: tmp = b * (b * 12.0) else: tmp = 4.0 * (b * (a * b)) return tmp
function code(a, b) tmp = 0.0 if (a <= 7.7e-31) tmp = Float64(b * Float64(b * 12.0)); else tmp = Float64(4.0 * Float64(b * Float64(a * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= 7.7e-31) tmp = b * (b * 12.0); else tmp = 4.0 * (b * (a * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, 7.7e-31], N[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(b * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.7 \cdot 10^{-31}:\\
\;\;\;\;b \cdot \left(b \cdot 12\right)\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(b \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 7.70000000000000012e-31Initial program 87.1%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.4
Simplified72.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6420.7
Simplified20.7%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6432.3
Simplified32.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6432.3
Applied egg-rr32.3%
if 7.70000000000000012e-31 < a Initial program 41.5%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6440.0
Simplified40.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6419.7
Simplified19.7%
Taylor expanded in a around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Simplified36.0%
Final simplification33.1%
(FPCore (a b) :precision binary64 (* b (* b 12.0)))
double code(double a, double b) {
return b * (b * 12.0);
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = b * (b * 12.0d0)
end function
public static double code(double a, double b) {
return b * (b * 12.0);
}
def code(a, b): return b * (b * 12.0)
function code(a, b) return Float64(b * Float64(b * 12.0)) end
function tmp = code(a, b) tmp = b * (b * 12.0); end
code[a_, b_] := N[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(b \cdot 12\right)
\end{array}
Initial program 76.4%
Taylor expanded in b around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.8
Simplified64.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6420.5
Simplified20.5%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.7
Simplified29.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6429.7
Applied egg-rr29.7%
Final simplification29.7%
(FPCore (a b) :precision binary64 (* b b))
double code(double a, double b) {
return b * b;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = b * b
end function
public static double code(double a, double b) {
return b * b;
}
def code(a, b): return b * b
function code(a, b) return Float64(b * b) end
function tmp = code(a, b) tmp = b * b; end
code[a_, b_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 76.4%
Taylor expanded in b around inf
lower-pow.f6421.5
Simplified21.5%
Taylor expanded in b around inf
unpow2N/A
lower-*.f6429.7
Simplified29.7%
herbie shell --seed 2024214
(FPCore (a b)
:name "Bouland and Aaronson, Equation (24)"
:precision binary64
(- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ 3.0 a))))) 1.0))