
(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 12 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
(+
(pow (+ (* a a) (* b b)) 2.0)
(* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ a 3.0)))))))
(if (<= t_0 INFINITY)
(+ t_0 -1.0)
(+ (* (* a a) (+ 4.0 (* a (+ a -4.0)))) -1.0))))
double code(double a, double b) {
double t_0 = pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0 + -1.0;
} else {
tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0;
}
return tmp;
}
public static double code(double a, double b) {
double t_0 = Math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0))));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0 + -1.0;
} else {
tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0;
}
return tmp;
}
def code(a, b): t_0 = math.pow(((a * a) + (b * b)), 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0)))) tmp = 0 if t_0 <= math.inf: tmp = t_0 + -1.0 else: tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0 return tmp
function code(a, b) t_0 = 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))))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(t_0 + -1.0); else tmp = Float64(Float64(Float64(a * a) * Float64(4.0 + Float64(a * Float64(a + -4.0)))) + -1.0); end return tmp end
function tmp_2 = code(a, b) t_0 = (((a * a) + (b * b)) ^ 2.0) + (4.0 * (((a * a) * (1.0 - a)) + ((b * b) * (a + 3.0)))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0 + -1.0; else tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 + -1.0), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[(4.0 + N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\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)\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0 + -1\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + -1\\
\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))))) < +inf.0Initial program 99.9%
if +inf.0 < (+.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 0.0%
Taylor expanded in b around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.9%
Simplified95.9%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6495.9%
Simplified95.9%
Final simplification98.8%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))) (t_1 (+ (* a a) (* b b))))
(if (<= a -9.5e+88)
t_0
(if (<= a 1.5e+77)
(+
(* t_1 t_1)
(+ (* 4.0 (+ (* a (* a (- 1.0 a))) (* b (* b (+ a 3.0))))) -1.0))
t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double t_1 = (a * a) + (b * b);
double tmp;
if (a <= -9.5e+88) {
tmp = t_0;
} else if (a <= 1.5e+77) {
tmp = (t_1 * t_1) + ((4.0 * ((a * (a * (1.0 - a))) + (b * (b * (a + 3.0))))) + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = a * (a * (a * a))
t_1 = (a * a) + (b * b)
if (a <= (-9.5d+88)) then
tmp = t_0
else if (a <= 1.5d+77) then
tmp = (t_1 * t_1) + ((4.0d0 * ((a * (a * (1.0d0 - a))) + (b * (b * (a + 3.0d0))))) + (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = a * (a * (a * a));
double t_1 = (a * a) + (b * b);
double tmp;
if (a <= -9.5e+88) {
tmp = t_0;
} else if (a <= 1.5e+77) {
tmp = (t_1 * t_1) + ((4.0 * ((a * (a * (1.0 - a))) + (b * (b * (a + 3.0))))) + -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) t_1 = (a * a) + (b * b) tmp = 0 if a <= -9.5e+88: tmp = t_0 elif a <= 1.5e+77: tmp = (t_1 * t_1) + ((4.0 * ((a * (a * (1.0 - a))) + (b * (b * (a + 3.0))))) + -1.0) else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(a * Float64(a * Float64(a * a))) t_1 = Float64(Float64(a * a) + Float64(b * b)) tmp = 0.0 if (a <= -9.5e+88) tmp = t_0; elseif (a <= 1.5e+77) tmp = Float64(Float64(t_1 * t_1) + Float64(Float64(4.0 * Float64(Float64(a * Float64(a * Float64(1.0 - a))) + Float64(b * Float64(b * Float64(a + 3.0))))) + -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = a * (a * (a * a)); t_1 = (a * a) + (b * b); tmp = 0.0; if (a <= -9.5e+88) tmp = t_0; elseif (a <= 1.5e+77) tmp = (t_1 * t_1) + ((4.0 * ((a * (a * (1.0 - a))) + (b * (b * (a + 3.0))))) + -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.5e+88], t$95$0, If[LessEqual[a, 1.5e+77], N[(N[(t$95$1 * t$95$1), $MachinePrecision] + N[(N[(4.0 * N[(N[(a * N[(a * N[(1.0 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(a + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
t_1 := a \cdot a + b \cdot b\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+77}:\\
\;\;\;\;t\_1 \cdot t\_1 + \left(4 \cdot \left(a \cdot \left(a \cdot \left(1 - a\right)\right) + b \cdot \left(b \cdot \left(a + 3\right)\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -9.50000000000000059e88 or 1.4999999999999999e77 < a Initial program 29.2%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified29.2%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if -9.50000000000000059e88 < a < 1.4999999999999999e77Initial program 98.0%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.0%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1.0) (+ (* (* a a) (+ 4.0 (* a (+ a -4.0)))) -1.0) (+ (* b (* b (+ (* b b) 12.0))) -1.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1.0d0) then
tmp = ((a * a) * (4.0d0 + (a * (a + (-4.0d0))))) + (-1.0d0)
else
tmp = (b * (b * ((b * b) + 12.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1.0: tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0 else: tmp = (b * (b * ((b * b) + 12.0))) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1.0) tmp = Float64(Float64(Float64(a * a) * Float64(4.0 + Float64(a * Float64(a + -4.0)))) + -1.0); else tmp = Float64(Float64(b * Float64(b * Float64(Float64(b * b) + 12.0))) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1.0) tmp = ((a * a) * (4.0 + (a * (a + -4.0)))) + -1.0; else tmp = (b * (b * ((b * b) + 12.0))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1.0], N[(N[(N[(a * a), $MachinePrecision] * N[(4.0 + N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * N[(b * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 1:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(4 + a \cdot \left(a + -4\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b + 12\right)\right) + -1\\
\end{array}
\end{array}
if (*.f64 b b) < 1Initial program 81.7%
Taylor expanded in b around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6499.9%
Simplified99.9%
if 1 < (*.f64 b b) Initial program 64.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
Final simplification96.7%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1.0) (+ (* (* a a) (* a (+ a -4.0))) -1.0) (+ (* b (* b (+ (* b b) 12.0))) -1.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * (a * (a + -4.0))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1.0d0) then
tmp = ((a * a) * (a * (a + (-4.0d0)))) + (-1.0d0)
else
tmp = (b * (b * ((b * b) + 12.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * (a * (a + -4.0))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1.0: tmp = ((a * a) * (a * (a + -4.0))) + -1.0 else: tmp = (b * (b * ((b * b) + 12.0))) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1.0) tmp = Float64(Float64(Float64(a * a) * Float64(a * Float64(a + -4.0))) + -1.0); else tmp = Float64(Float64(b * Float64(b * Float64(Float64(b * b) + 12.0))) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1.0) tmp = ((a * a) * (a * (a + -4.0))) + -1.0; else tmp = (b * (b * ((b * b) + 12.0))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1.0], N[(N[(N[(a * a), $MachinePrecision] * N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * N[(b * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 1:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot \left(a + -4\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b + 12\right)\right) + -1\\
\end{array}
\end{array}
if (*.f64 b b) < 1Initial program 81.7%
Taylor expanded in b around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in a around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in a around inf
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
unpow2N/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*l*N/A
associate-*l/N/A
*-lft-identityN/A
unpow2N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
distribute-rgt-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6498.5%
Simplified98.5%
if 1 < (*.f64 b b) Initial program 64.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
Final simplification96.0%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1.0) (+ (* a (* a (* a a))) -1.0) (+ (* b (* b (+ (* b b) 12.0))) -1.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = (a * (a * (a * a))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1.0d0) then
tmp = (a * (a * (a * a))) + (-1.0d0)
else
tmp = (b * (b * ((b * b) + 12.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = (a * (a * (a * a))) + -1.0;
} else {
tmp = (b * (b * ((b * b) + 12.0))) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1.0: tmp = (a * (a * (a * a))) + -1.0 else: tmp = (b * (b * ((b * b) + 12.0))) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1.0) tmp = Float64(Float64(a * Float64(a * Float64(a * a))) + -1.0); else tmp = Float64(Float64(b * Float64(b * Float64(Float64(b * b) + 12.0))) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1.0) tmp = (a * (a * (a * a))) + -1.0; else tmp = (b * (b * ((b * b) + 12.0))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1.0], N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(b * N[(b * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 1:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b + 12\right)\right) + -1\\
\end{array}
\end{array}
if (*.f64 b b) < 1Initial program 81.7%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.4%
Simplified98.4%
if 1 < (*.f64 b b) Initial program 64.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
Final simplification96.0%
(FPCore (a b) :precision binary64 (if (<= b 2.1e-196) (* a (* a (* a a))) (if (<= b 0.29) -1.0 (* b (* b (* b b))))))
double code(double a, double b) {
double tmp;
if (b <= 2.1e-196) {
tmp = a * (a * (a * a));
} else if (b <= 0.29) {
tmp = -1.0;
} else {
tmp = 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 <= 2.1d-196) then
tmp = a * (a * (a * a))
else if (b <= 0.29d0) then
tmp = -1.0d0
else
tmp = b * (b * (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 2.1e-196) {
tmp = a * (a * (a * a));
} else if (b <= 0.29) {
tmp = -1.0;
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 2.1e-196: tmp = a * (a * (a * a)) elif b <= 0.29: tmp = -1.0 else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (b <= 2.1e-196) tmp = Float64(a * Float64(a * Float64(a * a))); elseif (b <= 0.29) tmp = -1.0; else tmp = Float64(b * Float64(b * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 2.1e-196) tmp = a * (a * (a * a)); elseif (b <= 0.29) tmp = -1.0; else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 2.1e-196], N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.29], -1.0, N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.1 \cdot 10^{-196}:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{elif}\;b \leq 0.29:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 2.09999999999999988e-196Initial program 72.1%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified72.1%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.7%
Simplified47.7%
if 2.09999999999999988e-196 < b < 0.28999999999999998Initial program 86.8%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6458.2%
Simplified58.2%
Taylor expanded in b around 0
Simplified58.2%
if 0.28999999999999998 < b Initial program 64.2%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified64.2%
Taylor expanded in b around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
(FPCore (a b) :precision binary64 (let* ((t_0 (* a (* a (* a a))))) (if (<= a -0.42) t_0 (if (<= a 0.0185) -1.0 t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -0.42) {
tmp = t_0;
} else if (a <= 0.0185) {
tmp = -1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: tmp
t_0 = a * (a * (a * a))
if (a <= (-0.42d0)) then
tmp = t_0
else if (a <= 0.0185d0) then
tmp = -1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -0.42) {
tmp = t_0;
} else if (a <= 0.0185) {
tmp = -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -0.42: tmp = t_0 elif a <= 0.0185: tmp = -1.0 else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(a * Float64(a * Float64(a * a))) tmp = 0.0 if (a <= -0.42) tmp = t_0; elseif (a <= 0.0185) tmp = -1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = a * (a * (a * a)); tmp = 0.0; if (a <= -0.42) tmp = t_0; elseif (a <= 0.0185) tmp = -1.0; else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.42], t$95$0, If[LessEqual[a, 0.0185], -1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{if}\;a \leq -0.42:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.0185:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.419999999999999984 or 0.0184999999999999991 < a Initial program 46.2%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified46.2%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.7%
Simplified84.7%
if -0.419999999999999984 < a < 0.0184999999999999991Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6498.6%
Simplified98.6%
Taylor expanded in b around 0
Simplified47.5%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1.0) (+ (* a (* a (* a a))) -1.0) (* b (* b (+ (* b b) 12.0)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = (a * (a * (a * a))) + -1.0;
} else {
tmp = b * (b * ((b * b) + 12.0));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1.0d0) then
tmp = (a * (a * (a * a))) + (-1.0d0)
else
tmp = b * (b * ((b * b) + 12.0d0))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = (a * (a * (a * a))) + -1.0;
} else {
tmp = b * (b * ((b * b) + 12.0));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1.0: tmp = (a * (a * (a * a))) + -1.0 else: tmp = b * (b * ((b * b) + 12.0)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1.0) tmp = Float64(Float64(a * Float64(a * Float64(a * a))) + -1.0); else tmp = Float64(b * Float64(b * Float64(Float64(b * b) + 12.0))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1.0) tmp = (a * (a * (a * a))) + -1.0; else tmp = b * (b * ((b * b) + 12.0)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1.0], N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 1:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b + 12\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 1Initial program 81.7%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.4%
Simplified98.4%
if 1 < (*.f64 b b) Initial program 64.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.0%
Applied egg-rr94.0%
Taylor expanded in b around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6493.6%
Simplified93.6%
Final simplification95.7%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1.0) (+ (* (* a a) 4.0) -1.0) (* b (* b (+ (* b b) 12.0)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = b * (b * ((b * b) + 12.0));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b * b) <= 1.0d0) then
tmp = ((a * a) * 4.0d0) + (-1.0d0)
else
tmp = b * (b * ((b * b) + 12.0d0))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 1.0) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = b * (b * ((b * b) + 12.0));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1.0: tmp = ((a * a) * 4.0) + -1.0 else: tmp = b * (b * ((b * b) + 12.0)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1.0) tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0); else tmp = Float64(b * Float64(b * Float64(Float64(b * b) + 12.0))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 1.0) tmp = ((a * a) * 4.0) + -1.0; else tmp = b * (b * ((b * b) + 12.0)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1.0], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 1:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b + 12\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 1Initial program 81.7%
Taylor expanded in b around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in a around 0
Simplified77.9%
if 1 < (*.f64 b b) Initial program 64.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.0%
Applied egg-rr94.0%
Taylor expanded in b around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6493.6%
Simplified93.6%
Final simplification86.6%
(FPCore (a b) :precision binary64 (if (<= b 14.8) (+ (* (* a a) 4.0) -1.0) (* b (* b (* b b)))))
double code(double a, double b) {
double tmp;
if (b <= 14.8) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = 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 <= 14.8d0) then
tmp = ((a * a) * 4.0d0) + (-1.0d0)
else
tmp = b * (b * (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 14.8) {
tmp = ((a * a) * 4.0) + -1.0;
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 14.8: tmp = ((a * a) * 4.0) + -1.0 else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (b <= 14.8) tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0); else tmp = Float64(b * Float64(b * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 14.8) tmp = ((a * a) * 4.0) + -1.0; else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 14.8], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 14.8:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 14.800000000000001Initial program 75.0%
Taylor expanded in b around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.6%
Simplified77.6%
Taylor expanded in a around 0
Simplified57.7%
if 14.800000000000001 < b Initial program 64.2%
associate--l+N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified64.2%
Taylor expanded in b around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.0%
Simplified94.0%
Final simplification67.2%
(FPCore (a b) :precision binary64 (if (<= b 0.29) -1.0 (* (* b b) 12.0)))
double code(double a, double b) {
double tmp;
if (b <= 0.29) {
tmp = -1.0;
} else {
tmp = (b * b) * 12.0;
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.29d0) then
tmp = -1.0d0
else
tmp = (b * b) * 12.0d0
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (b <= 0.29) {
tmp = -1.0;
} else {
tmp = (b * b) * 12.0;
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 0.29: tmp = -1.0 else: tmp = (b * b) * 12.0 return tmp
function code(a, b) tmp = 0.0 if (b <= 0.29) tmp = -1.0; else tmp = Float64(Float64(b * b) * 12.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 0.29) tmp = -1.0; else tmp = (b * b) * 12.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 0.29], -1.0, N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.29:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12\\
\end{array}
\end{array}
if b < 0.28999999999999998Initial program 75.0%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
Taylor expanded in b around 0
Simplified31.4%
if 0.28999999999999998 < b Initial program 64.2%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6495.8%
Simplified95.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.8%
Applied egg-rr95.8%
Taylor expanded in b around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l*N/A
lft-mult-inverseN/A
*-commutativeN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6495.0%
Simplified95.0%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.6%
Simplified55.6%
Final simplification37.7%
(FPCore (a b) :precision binary64 -1.0)
double code(double a, double b) {
return -1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = -1.0d0
end function
public static double code(double a, double b) {
return -1.0;
}
def code(a, b): return -1.0
function code(a, b) return -1.0 end
function tmp = code(a, b) tmp = -1.0; end
code[a_, b_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 72.2%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6474.7%
Simplified74.7%
Taylor expanded in b around 0
Simplified23.4%
herbie shell --seed 2024184
(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))