
(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 14 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 (+ (* a a) (* b b)))) (+ (+ (/ t_0 (/ 1.0 t_0)) (* 4.0 (* (* b b) 3.0))) -1.0)))
double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return ((t_0 / (1.0 / t_0)) + (4.0 * ((b * b) * 3.0))) + -1.0;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
t_0 = (a * a) + (b * b)
code = ((t_0 / (1.0d0 / t_0)) + (4.0d0 * ((b * b) * 3.0d0))) + (-1.0d0)
end function
public static double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return ((t_0 / (1.0 / t_0)) + (4.0 * ((b * b) * 3.0))) + -1.0;
}
def code(a, b): t_0 = (a * a) + (b * b) return ((t_0 / (1.0 / t_0)) + (4.0 * ((b * b) * 3.0))) + -1.0
function code(a, b) t_0 = Float64(Float64(a * a) + Float64(b * b)) return Float64(Float64(Float64(t_0 / Float64(1.0 / t_0)) + Float64(4.0 * Float64(Float64(b * b) * 3.0))) + -1.0) end
function tmp = code(a, b) t_0 = (a * a) + (b * b); tmp = ((t_0 / (1.0 / t_0)) + (4.0 * ((b * b) * 3.0))) + -1.0; end
code[a_, b_] := Block[{t$95$0 = N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(t$95$0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot a + b \cdot b\\
\left(\frac{t\_0}{\frac{1}{t\_0}} + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right) + -1
\end{array}
\end{array}
Initial program 76.1%
unpow2N/A
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Applied egg-rr76.1%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification99.3%
(FPCore (a b)
:precision binary64
(let* ((t_0
(+
(+ (* 4.0 (* (* b b) 3.0)) (/ 1.0 (/ (/ 1.0 a) (* a (* a a)))))
-1.0)))
(if (<= a -0.0034)
t_0
(if (<= a 8.5e+21) (+ (* (* b b) (+ (* b b) 12.0)) -1.0) t_0))))
double code(double a, double b) {
double t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0;
double tmp;
if (a <= -0.0034) {
tmp = t_0;
} else if (a <= 8.5e+21) {
tmp = ((b * b) * ((b * b) + 12.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) :: tmp
t_0 = ((4.0d0 * ((b * b) * 3.0d0)) + (1.0d0 / ((1.0d0 / a) / (a * (a * a))))) + (-1.0d0)
if (a <= (-0.0034d0)) then
tmp = t_0
else if (a <= 8.5d+21) then
tmp = ((b * b) * ((b * b) + 12.0d0)) + (-1.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0;
double tmp;
if (a <= -0.0034) {
tmp = t_0;
} else if (a <= 8.5e+21) {
tmp = ((b * b) * ((b * b) + 12.0)) + -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0 tmp = 0 if a <= -0.0034: tmp = t_0 elif a <= 8.5e+21: tmp = ((b * b) * ((b * b) + 12.0)) + -1.0 else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(Float64(Float64(4.0 * Float64(Float64(b * b) * 3.0)) + Float64(1.0 / Float64(Float64(1.0 / a) / Float64(a * Float64(a * a))))) + -1.0) tmp = 0.0 if (a <= -0.0034) tmp = t_0; elseif (a <= 8.5e+21) tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 12.0)) + -1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = ((4.0 * ((b * b) * 3.0)) + (1.0 / ((1.0 / a) / (a * (a * a))))) + -1.0; tmp = 0.0; if (a <= -0.0034) tmp = t_0; elseif (a <= 8.5e+21) tmp = ((b * b) * ((b * b) + 12.0)) + -1.0; else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(N[(N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[(1.0 / a), $MachinePrecision] / N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[a, -0.0034], t$95$0, If[LessEqual[a, 8.5e+21], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(4 \cdot \left(\left(b \cdot b\right) \cdot 3\right) + \frac{1}{\frac{\frac{1}{a}}{a \cdot \left(a \cdot a\right)}}\right) + -1\\
\mathbf{if}\;a \leq -0.0034:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+21}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.00339999999999999981 or 8.5e21 < a Initial program 47.8%
unpow2N/A
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Applied egg-rr47.8%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.4%
Simplified99.4%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.4%
Applied egg-rr99.4%
Taylor expanded in a around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.8%
Simplified97.8%
if -0.00339999999999999981 < a < 8.5e21Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6499.4%
Simplified99.4%
Final simplification98.7%
(FPCore (a b)
:precision binary64
(if (<= (* b b) 5e-15)
(+ (* (* a a) (+ (* a a) (* 4.0 (- 1.0 a)))) -1.0)
(+
(+ (* 4.0 (* (* b b) 3.0)) (/ (+ (* a a) (* b b)) (/ 1.0 (* b b))))
-1.0)))
double code(double a, double b) {
double tmp;
if ((b * b) <= 5e-15) {
tmp = ((a * a) * ((a * a) + (4.0 * (1.0 - a)))) + -1.0;
} else {
tmp = ((4.0 * ((b * b) * 3.0)) + (((a * a) + (b * b)) / (1.0 / (b * b)))) + -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) <= 5d-15) then
tmp = ((a * a) * ((a * a) + (4.0d0 * (1.0d0 - a)))) + (-1.0d0)
else
tmp = ((4.0d0 * ((b * b) * 3.0d0)) + (((a * a) + (b * b)) / (1.0d0 / (b * b)))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 5e-15) {
tmp = ((a * a) * ((a * a) + (4.0 * (1.0 - a)))) + -1.0;
} else {
tmp = ((4.0 * ((b * b) * 3.0)) + (((a * a) + (b * b)) / (1.0 / (b * b)))) + -1.0;
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 5e-15: tmp = ((a * a) * ((a * a) + (4.0 * (1.0 - a)))) + -1.0 else: tmp = ((4.0 * ((b * b) * 3.0)) + (((a * a) + (b * b)) / (1.0 / (b * b)))) + -1.0 return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 5e-15) tmp = Float64(Float64(Float64(a * a) * Float64(Float64(a * a) + Float64(4.0 * Float64(1.0 - a)))) + -1.0); else tmp = Float64(Float64(Float64(4.0 * Float64(Float64(b * b) * 3.0)) + Float64(Float64(Float64(a * a) + Float64(b * b)) / Float64(1.0 / Float64(b * b)))) + -1.0); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 5e-15) tmp = ((a * a) * ((a * a) + (4.0 * (1.0 - a)))) + -1.0; else tmp = ((4.0 * ((b * b) * 3.0)) + (((a * a) + (b * b)) / (1.0 / (b * b)))) + -1.0; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 5e-15], N[(N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] + N[(4.0 * N[(1.0 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(N[(N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(a \cdot a + 4 \cdot \left(1 - a\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\left(4 \cdot \left(\left(b \cdot b\right) \cdot 3\right) + \frac{a \cdot a + b \cdot b}{\frac{1}{b \cdot b}}\right) + -1\\
\end{array}
\end{array}
if (*.f64 b b) < 4.99999999999999999e-15Initial program 81.9%
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%
if 4.99999999999999999e-15 < (*.f64 b b) Initial program 69.8%
unpow2N/A
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
Applied egg-rr69.8%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in a around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6497.6%
Simplified97.6%
Final simplification98.8%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -2.6e+18)
t_0
(if (<= a 4.2e-308)
(* (* b b) (* b b))
(if (<= a 5e-64) -1.0 (if (<= a 3.5e+34) (* b (* b (* b b))) t_0))))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -2.6e+18) {
tmp = t_0;
} else if (a <= 4.2e-308) {
tmp = (b * b) * (b * b);
} else if (a <= 5e-64) {
tmp = -1.0;
} else if (a <= 3.5e+34) {
tmp = b * (b * (b * b));
} 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 <= (-2.6d+18)) then
tmp = t_0
else if (a <= 4.2d-308) then
tmp = (b * b) * (b * b)
else if (a <= 5d-64) then
tmp = -1.0d0
else if (a <= 3.5d+34) then
tmp = b * (b * (b * b))
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 <= -2.6e+18) {
tmp = t_0;
} else if (a <= 4.2e-308) {
tmp = (b * b) * (b * b);
} else if (a <= 5e-64) {
tmp = -1.0;
} else if (a <= 3.5e+34) {
tmp = b * (b * (b * b));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -2.6e+18: tmp = t_0 elif a <= 4.2e-308: tmp = (b * b) * (b * b) elif a <= 5e-64: tmp = -1.0 elif a <= 3.5e+34: tmp = b * (b * (b * b)) else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(a * Float64(a * Float64(a * a))) tmp = 0.0 if (a <= -2.6e+18) tmp = t_0; elseif (a <= 4.2e-308) tmp = Float64(Float64(b * b) * Float64(b * b)); elseif (a <= 5e-64) tmp = -1.0; elseif (a <= 3.5e+34) tmp = Float64(b * Float64(b * Float64(b * b))); 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 <= -2.6e+18) tmp = t_0; elseif (a <= 4.2e-308) tmp = (b * b) * (b * b); elseif (a <= 5e-64) tmp = -1.0; elseif (a <= 3.5e+34) tmp = b * (b * (b * b)); 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, -2.6e+18], t$95$0, If[LessEqual[a, 4.2e-308], N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-64], -1.0, If[LessEqual[a, 3.5e+34], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 -2.6 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-308}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-64}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -2.6e18 or 3.49999999999999998e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -2.6e18 < a < 4.2e-308Initial program 96.7%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6498.9%
Simplified98.9%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6498.9%
Applied egg-rr98.9%
Taylor expanded in b around inf
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
lft-mult-inverseN/A
*-lft-identityN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6462.3%
Simplified62.3%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f6461.7%
Simplified61.7%
if 4.2e-308 < a < 5.00000000000000033e-64Initial program 99.9%
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-*.f6463.7%
Simplified63.7%
Taylor expanded in a around 0
Simplified63.7%
if 5.00000000000000033e-64 < a < 3.49999999999999998e34Initial program 100.0%
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-*.f6484.7%
Simplified84.7%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))) (t_1 (* b (* b (* b b)))))
(if (<= a -1.42e+18)
t_0
(if (<= a -3.35e-307)
t_1
(if (<= a 4.8e-64) -1.0 (if (<= a 3.2e+34) t_1 t_0))))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double t_1 = b * (b * (b * b));
double tmp;
if (a <= -1.42e+18) {
tmp = t_0;
} else if (a <= -3.35e-307) {
tmp = t_1;
} else if (a <= 4.8e-64) {
tmp = -1.0;
} else if (a <= 3.2e+34) {
tmp = t_1;
} 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 = b * (b * (b * b))
if (a <= (-1.42d+18)) then
tmp = t_0
else if (a <= (-3.35d-307)) then
tmp = t_1
else if (a <= 4.8d-64) then
tmp = -1.0d0
else if (a <= 3.2d+34) then
tmp = t_1
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 = b * (b * (b * b));
double tmp;
if (a <= -1.42e+18) {
tmp = t_0;
} else if (a <= -3.35e-307) {
tmp = t_1;
} else if (a <= 4.8e-64) {
tmp = -1.0;
} else if (a <= 3.2e+34) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) t_1 = b * (b * (b * b)) tmp = 0 if a <= -1.42e+18: tmp = t_0 elif a <= -3.35e-307: tmp = t_1 elif a <= 4.8e-64: tmp = -1.0 elif a <= 3.2e+34: tmp = t_1 else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(a * Float64(a * Float64(a * a))) t_1 = Float64(b * Float64(b * Float64(b * b))) tmp = 0.0 if (a <= -1.42e+18) tmp = t_0; elseif (a <= -3.35e-307) tmp = t_1; elseif (a <= 4.8e-64) tmp = -1.0; elseif (a <= 3.2e+34) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = a * (a * (a * a)); t_1 = b * (b * (b * b)); tmp = 0.0; if (a <= -1.42e+18) tmp = t_0; elseif (a <= -3.35e-307) tmp = t_1; elseif (a <= 4.8e-64) tmp = -1.0; elseif (a <= 3.2e+34) tmp = t_1; 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[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.42e+18], t$95$0, If[LessEqual[a, -3.35e-307], t$95$1, If[LessEqual[a, 4.8e-64], -1.0, If[LessEqual[a, 3.2e+34], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
t_1 := b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\mathbf{if}\;a \leq -1.42 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq -3.35 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-64}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.42e18 or 3.1999999999999998e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -1.42e18 < a < -3.3499999999999999e-307 or 4.79999999999999997e-64 < a < 3.1999999999999998e34Initial program 97.5%
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-*.f6467.1%
Simplified67.1%
if -3.3499999999999999e-307 < a < 4.79999999999999997e-64Initial program 99.9%
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-*.f6463.7%
Simplified63.7%
Taylor expanded in a around 0
Simplified63.7%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))) (t_1 (* b (* b 12.0))))
(if (<= a -1.3e+18)
t_0
(if (<= a -2.3e-267)
t_1
(if (<= a 2.2e-63) -1.0 (if (<= a 3.2e+34) t_1 t_0))))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double t_1 = b * (b * 12.0);
double tmp;
if (a <= -1.3e+18) {
tmp = t_0;
} else if (a <= -2.3e-267) {
tmp = t_1;
} else if (a <= 2.2e-63) {
tmp = -1.0;
} else if (a <= 3.2e+34) {
tmp = t_1;
} 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 = b * (b * 12.0d0)
if (a <= (-1.3d+18)) then
tmp = t_0
else if (a <= (-2.3d-267)) then
tmp = t_1
else if (a <= 2.2d-63) then
tmp = -1.0d0
else if (a <= 3.2d+34) then
tmp = t_1
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 = b * (b * 12.0);
double tmp;
if (a <= -1.3e+18) {
tmp = t_0;
} else if (a <= -2.3e-267) {
tmp = t_1;
} else if (a <= 2.2e-63) {
tmp = -1.0;
} else if (a <= 3.2e+34) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) t_1 = b * (b * 12.0) tmp = 0 if a <= -1.3e+18: tmp = t_0 elif a <= -2.3e-267: tmp = t_1 elif a <= 2.2e-63: tmp = -1.0 elif a <= 3.2e+34: tmp = t_1 else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(a * Float64(a * Float64(a * a))) t_1 = Float64(b * Float64(b * 12.0)) tmp = 0.0 if (a <= -1.3e+18) tmp = t_0; elseif (a <= -2.3e-267) tmp = t_1; elseif (a <= 2.2e-63) tmp = -1.0; elseif (a <= 3.2e+34) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = a * (a * (a * a)); t_1 = b * (b * 12.0); tmp = 0.0; if (a <= -1.3e+18) tmp = t_0; elseif (a <= -2.3e-267) tmp = t_1; elseif (a <= 2.2e-63) tmp = -1.0; elseif (a <= 3.2e+34) tmp = t_1; 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[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.3e+18], t$95$0, If[LessEqual[a, -2.3e-267], t$95$1, If[LessEqual[a, 2.2e-63], -1.0, If[LessEqual[a, 3.2e+34], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
t_1 := b \cdot \left(b \cdot 12\right)\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-63}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.3e18 or 3.1999999999999998e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -1.3e18 < a < -2.30000000000000005e-267 or 2.2e-63 < a < 3.1999999999999998e34Initial program 97.1%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6498.0%
Simplified98.0%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
Taylor expanded in b around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6448.8%
Simplified48.8%
if -2.30000000000000005e-267 < a < 2.2e-63Initial program 99.9%
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-*.f6461.9%
Simplified61.9%
Taylor expanded in a around 0
Simplified61.9%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -2.5e+18)
t_0
(if (<= a 3.3e+34) (+ (* (* b b) (+ (* b b) 12.0)) -1.0) t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -2.5e+18) {
tmp = t_0;
} else if (a <= 3.3e+34) {
tmp = ((b * b) * ((b * b) + 12.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) :: tmp
t_0 = a * (a * (a * a))
if (a <= (-2.5d+18)) then
tmp = t_0
else if (a <= 3.3d+34) then
tmp = ((b * b) * ((b * b) + 12.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 tmp;
if (a <= -2.5e+18) {
tmp = t_0;
} else if (a <= 3.3e+34) {
tmp = ((b * b) * ((b * b) + 12.0)) + -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -2.5e+18: tmp = t_0 elif a <= 3.3e+34: tmp = ((b * b) * ((b * b) + 12.0)) + -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 <= -2.5e+18) tmp = t_0; elseif (a <= 3.3e+34) tmp = Float64(Float64(Float64(b * b) * Float64(Float64(b * b) + 12.0)) + -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 <= -2.5e+18) tmp = t_0; elseif (a <= 3.3e+34) tmp = ((b * b) * ((b * b) + 12.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]}, If[LessEqual[a, -2.5e+18], t$95$0, If[LessEqual[a, 3.3e+34], N[(N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -2.5 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b + 12\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -2.5e18 or 3.29999999999999988e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -2.5e18 < a < 3.29999999999999988e34Initial program 98.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6499.0%
Simplified99.0%
Final simplification97.2%
(FPCore (a b) :precision binary64 (if (<= (* b b) 2e-68) (+ (* (* a a) 4.0) -1.0) (if (<= (* b b) 2e+115) (* a (* a (* a a))) (* b (* b (* b b))))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 2e-68) {
tmp = ((a * a) * 4.0) + -1.0;
} else if ((b * b) <= 2e+115) {
tmp = a * (a * (a * a));
} 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 * b) <= 2d-68) then
tmp = ((a * a) * 4.0d0) + (-1.0d0)
else if ((b * b) <= 2d+115) then
tmp = a * (a * (a * a))
else
tmp = b * (b * (b * b))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if ((b * b) <= 2e-68) {
tmp = ((a * a) * 4.0) + -1.0;
} else if ((b * b) <= 2e+115) {
tmp = a * (a * (a * a));
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 2e-68: tmp = ((a * a) * 4.0) + -1.0 elif (b * b) <= 2e+115: tmp = a * (a * (a * a)) else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 2e-68) tmp = Float64(Float64(Float64(a * a) * 4.0) + -1.0); elseif (Float64(b * b) <= 2e+115) tmp = Float64(a * Float64(a * Float64(a * a))); else tmp = Float64(b * Float64(b * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if ((b * b) <= 2e-68) tmp = ((a * a) * 4.0) + -1.0; elseif ((b * b) <= 2e+115) tmp = a * (a * (a * a)); else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 2e-68], N[(N[(N[(a * a), $MachinePrecision] * 4.0), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(b * b), $MachinePrecision], 2e+115], N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{-68}:\\
\;\;\;\;\left(a \cdot a\right) \cdot 4 + -1\\
\mathbf{elif}\;b \cdot b \leq 2 \cdot 10^{+115}:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 2.00000000000000013e-68Initial program 82.3%
Taylor expanded in a around 0
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.9%
Simplified68.9%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
sub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6468.9%
Simplified68.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.5%
Simplified82.5%
if 2.00000000000000013e-68 < (*.f64 b b) < 2e115Initial program 69.0%
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-*.f6465.1%
Simplified65.1%
if 2e115 < (*.f64 b b) Initial program 71.4%
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-*.f6499.0%
Simplified99.0%
Final simplification86.2%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -1.9e+18)
t_0
(if (<= a 3.3e+34) (+ (* (* b b) (* b b)) -1.0) t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -1.9e+18) {
tmp = t_0;
} else if (a <= 3.3e+34) {
tmp = ((b * b) * (b * b)) + -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 <= (-1.9d+18)) then
tmp = t_0
else if (a <= 3.3d+34) then
tmp = ((b * b) * (b * b)) + (-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 <= -1.9e+18) {
tmp = t_0;
} else if (a <= 3.3e+34) {
tmp = ((b * b) * (b * b)) + -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -1.9e+18: tmp = t_0 elif a <= 3.3e+34: tmp = ((b * b) * (b * b)) + -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 <= -1.9e+18) tmp = t_0; elseif (a <= 3.3e+34) tmp = Float64(Float64(Float64(b * b) * Float64(b * b)) + -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 <= -1.9e+18) tmp = t_0; elseif (a <= 3.3e+34) tmp = ((b * b) * (b * b)) + -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, -1.9e+18], t$95$0, If[LessEqual[a, 3.3e+34], N[(N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.9 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+34}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \left(b \cdot b\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.9e18 or 3.29999999999999988e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -1.9e18 < a < 3.29999999999999988e34Initial program 98.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6499.0%
Simplified99.0%
Taylor expanded in b around inf
unpow2N/A
*-lowering-*.f6498.1%
Simplified98.1%
Final simplification96.7%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -1.5e+18)
t_0
(if (<= a 3.55e+34) (+ (* b (* b (* b b))) -1.0) t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -1.5e+18) {
tmp = t_0;
} else if (a <= 3.55e+34) {
tmp = (b * (b * (b * b))) + -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 <= (-1.5d+18)) then
tmp = t_0
else if (a <= 3.55d+34) then
tmp = (b * (b * (b * b))) + (-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 <= -1.5e+18) {
tmp = t_0;
} else if (a <= 3.55e+34) {
tmp = (b * (b * (b * b))) + -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -1.5e+18: tmp = t_0 elif a <= 3.55e+34: tmp = (b * (b * (b * b))) + -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 <= -1.5e+18) tmp = t_0; elseif (a <= 3.55e+34) tmp = Float64(Float64(b * Float64(b * Float64(b * b))) + -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 <= -1.5e+18) tmp = t_0; elseif (a <= 3.55e+34) tmp = (b * (b * (b * b))) + -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, -1.5e+18], t$95$0, If[LessEqual[a, 3.55e+34], N[(N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.5 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 3.55 \cdot 10^{+34}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.5e18 or 3.54999999999999978e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -1.5e18 < a < 3.54999999999999978e34Initial program 98.5%
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-*.f6498.1%
Simplified98.1%
Final simplification96.7%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -1.25e+18)
t_0
(if (<= a 3.25e+34) (+ (* (* b b) 12.0) -1.0) t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -1.25e+18) {
tmp = t_0;
} else if (a <= 3.25e+34) {
tmp = ((b * b) * 12.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) :: tmp
t_0 = a * (a * (a * a))
if (a <= (-1.25d+18)) then
tmp = t_0
else if (a <= 3.25d+34) then
tmp = ((b * b) * 12.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 tmp;
if (a <= -1.25e+18) {
tmp = t_0;
} else if (a <= 3.25e+34) {
tmp = ((b * b) * 12.0) + -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -1.25e+18: tmp = t_0 elif a <= 3.25e+34: tmp = ((b * b) * 12.0) + -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 <= -1.25e+18) tmp = t_0; elseif (a <= 3.25e+34) tmp = Float64(Float64(Float64(b * b) * 12.0) + -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 <= -1.25e+18) tmp = t_0; elseif (a <= 3.25e+34) tmp = ((b * b) * 12.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]}, If[LessEqual[a, -1.25e+18], t$95$0, If[LessEqual[a, 3.25e+34], N[(N[(N[(b * b), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision], 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 -1.25 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 3.25 \cdot 10^{+34}:\\
\;\;\;\;\left(b \cdot b\right) \cdot 12 + -1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.25e18 or 3.25000000000000008e34 < a Initial program 46.8%
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-*.f6494.9%
Simplified94.9%
if -1.25e18 < a < 3.25000000000000008e34Initial program 98.5%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6499.0%
Simplified99.0%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.7%
Simplified79.7%
Final simplification86.3%
(FPCore (a b) :precision binary64 (if (<= (* b b) 2e+115) (+ (* a (* a (* a a))) -1.0) (* b (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 2e+115) {
tmp = (a * (a * (a * a))) + -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 * b) <= 2d+115) then
tmp = (a * (a * (a * a))) + (-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 * b) <= 2e+115) {
tmp = (a * (a * (a * a))) + -1.0;
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 2e+115: tmp = (a * (a * (a * a))) + -1.0 else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 2e+115) tmp = Float64(Float64(a * Float64(a * Float64(a * a))) + -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 * b) <= 2e+115) tmp = (a * (a * (a * a))) + -1.0; else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 2e+115], N[(N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \cdot b \leq 2 \cdot 10^{+115}:\\
\;\;\;\;a \cdot \left(a \cdot \left(a \cdot a\right)\right) + -1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 2e115Initial program 79.0%
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-*.f6491.6%
Simplified91.6%
if 2e115 < (*.f64 b b) Initial program 71.4%
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-*.f6499.0%
Simplified99.0%
Final simplification94.5%
(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(b * Float64(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[(b * N[(b * 12.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.29:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot 12\right)\\
\end{array}
\end{array}
if b < 0.28999999999999998Initial program 78.3%
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-*.f6478.4%
Simplified78.4%
Taylor expanded in a around 0
Simplified34.3%
if 0.28999999999999998 < b Initial program 69.2%
Taylor expanded in a around 0
+-commutativeN/A
metadata-evalN/A
pow-sqrN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6490.7%
Simplified90.7%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.1%
Simplified59.1%
Taylor expanded in b around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6459.1%
Simplified59.1%
(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 76.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-*.f6467.1%
Simplified67.1%
Taylor expanded in a around 0
Simplified26.2%
herbie shell --seed 2024194
(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))