
(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 13 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 (+ (+ -1.0 (* (+ 4.0 (* a (+ a -4.0))) (* a a))) (* b (* b (+ (+ 12.0 (* b b)) (* a (+ 4.0 (* a 2.0))))))))
double code(double a, double b) {
return (-1.0 + ((4.0 + (a * (a + -4.0))) * (a * a))) + (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0))))));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((-1.0d0) + ((4.0d0 + (a * (a + (-4.0d0)))) * (a * a))) + (b * (b * ((12.0d0 + (b * b)) + (a * (4.0d0 + (a * 2.0d0))))))
end function
public static double code(double a, double b) {
return (-1.0 + ((4.0 + (a * (a + -4.0))) * (a * a))) + (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0))))));
}
def code(a, b): return (-1.0 + ((4.0 + (a * (a + -4.0))) * (a * a))) + (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0))))))
function code(a, b) return Float64(Float64(-1.0 + Float64(Float64(4.0 + Float64(a * Float64(a + -4.0))) * Float64(a * a))) + Float64(b * Float64(b * Float64(Float64(12.0 + Float64(b * b)) + Float64(a * Float64(4.0 + Float64(a * 2.0))))))) end
function tmp = code(a, b) tmp = (-1.0 + ((4.0 + (a * (a + -4.0))) * (a * a))) + (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0)))))); end
code[a_, b_] := N[(N[(-1.0 + N[(N[(4.0 + N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(N[(12.0 + N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(a * N[(4.0 + N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-1 + \left(4 + a \cdot \left(a + -4\right)\right) \cdot \left(a \cdot a\right)\right) + b \cdot \left(b \cdot \left(\left(12 + b \cdot b\right) + a \cdot \left(4 + a \cdot 2\right)\right)\right)
\end{array}
Initial program 76.4%
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
Simplified76.4%
Taylor expanded in b around 0
Simplified99.9%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6499.9%
Simplified99.9%
Final simplification99.9%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -0.41)
t_0
(if (<= a -1.82e-68)
-1.0
(if (<= a -7.5e-176)
(* b (* b (* b b)))
(if (<= a 2.3e-5) -1.0 t_0))))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -0.41) {
tmp = t_0;
} else if (a <= -1.82e-68) {
tmp = -1.0;
} else if (a <= -7.5e-176) {
tmp = b * (b * (b * b));
} else if (a <= 2.3e-5) {
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.41d0)) then
tmp = t_0
else if (a <= (-1.82d-68)) then
tmp = -1.0d0
else if (a <= (-7.5d-176)) then
tmp = b * (b * (b * b))
else if (a <= 2.3d-5) 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.41) {
tmp = t_0;
} else if (a <= -1.82e-68) {
tmp = -1.0;
} else if (a <= -7.5e-176) {
tmp = b * (b * (b * b));
} else if (a <= 2.3e-5) {
tmp = -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -0.41: tmp = t_0 elif a <= -1.82e-68: tmp = -1.0 elif a <= -7.5e-176: tmp = b * (b * (b * b)) elif a <= 2.3e-5: 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.41) tmp = t_0; elseif (a <= -1.82e-68) tmp = -1.0; elseif (a <= -7.5e-176) tmp = Float64(b * Float64(b * Float64(b * b))); elseif (a <= 2.3e-5) 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.41) tmp = t_0; elseif (a <= -1.82e-68) tmp = -1.0; elseif (a <= -7.5e-176) tmp = b * (b * (b * b)); elseif (a <= 2.3e-5) 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.41], t$95$0, If[LessEqual[a, -1.82e-68], -1.0, If[LessEqual[a, -7.5e-176], N[(b * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-5], -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.41:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq -1.82 \cdot 10^{-68}:\\
\;\;\;\;-1\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-176}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-5}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.409999999999999976 or 2.3e-5 < a Initial program 56.3%
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
Simplified56.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-*.f6488.7%
Simplified88.7%
if -0.409999999999999976 < a < -1.81999999999999994e-68 or -7.5e-176 < a < 2.3e-5Initial program 99.9%
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
Simplified99.9%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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--.f6461.0%
Simplified61.0%
Taylor expanded in a around 0
Simplified60.7%
if -1.81999999999999994e-68 < a < -7.5e-176Initial program 99.9%
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
Simplified99.9%
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-*.f6472.2%
Simplified72.2%
(FPCore (a b) :precision binary64 (+ (* b (* b (+ (+ 12.0 (* b b)) (* a (+ 4.0 (* a 2.0)))))) (+ -1.0 (* (* a a) (* a a)))))
double code(double a, double b) {
return (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0)))))) + (-1.0 + ((a * a) * (a * a)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (b * (b * ((12.0d0 + (b * b)) + (a * (4.0d0 + (a * 2.0d0)))))) + ((-1.0d0) + ((a * a) * (a * a)))
end function
public static double code(double a, double b) {
return (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0)))))) + (-1.0 + ((a * a) * (a * a)));
}
def code(a, b): return (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0)))))) + (-1.0 + ((a * a) * (a * a)))
function code(a, b) return Float64(Float64(b * Float64(b * Float64(Float64(12.0 + Float64(b * b)) + Float64(a * Float64(4.0 + Float64(a * 2.0)))))) + Float64(-1.0 + Float64(Float64(a * a) * Float64(a * a)))) end
function tmp = code(a, b) tmp = (b * (b * ((12.0 + (b * b)) + (a * (4.0 + (a * 2.0)))))) + (-1.0 + ((a * a) * (a * a))); end
code[a_, b_] := N[(N[(b * N[(b * N[(N[(12.0 + N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(a * N[(4.0 + N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(b \cdot \left(\left(12 + b \cdot b\right) + a \cdot \left(4 + a \cdot 2\right)\right)\right) + \left(-1 + \left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)
\end{array}
Initial program 76.4%
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
Simplified76.4%
Taylor expanded in b around 0
Simplified99.9%
Taylor expanded in a around inf
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Final simplification98.8%
(FPCore (a b) :precision binary64 (let* ((t_0 (+ (* a a) (* b b)))) (+ (* t_0 t_0) (+ -1.0 (* 4.0 (* (* b b) 3.0))))))
double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return (t_0 * t_0) + (-1.0 + (4.0 * ((b * b) * 3.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 * t_0) + ((-1.0d0) + (4.0d0 * ((b * b) * 3.0d0)))
end function
public static double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return (t_0 * t_0) + (-1.0 + (4.0 * ((b * b) * 3.0)));
}
def code(a, b): t_0 = (a * a) + (b * b) return (t_0 * t_0) + (-1.0 + (4.0 * ((b * b) * 3.0)))
function code(a, b) t_0 = Float64(Float64(a * a) + Float64(b * b)) return Float64(Float64(t_0 * t_0) + Float64(-1.0 + Float64(4.0 * Float64(Float64(b * b) * 3.0)))) end
function tmp = code(a, b) t_0 = (a * a) + (b * b); tmp = (t_0 * t_0) + (-1.0 + (4.0 * ((b * b) * 3.0))); end
code[a_, b_] := Block[{t$95$0 = N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(-1.0 + N[(4.0 * N[(N[(b * b), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot a + b \cdot b\\
t\_0 \cdot t\_0 + \left(-1 + 4 \cdot \left(\left(b \cdot b\right) \cdot 3\right)\right)
\end{array}
\end{array}
Initial program 76.4%
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
Simplified76.4%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.8%
Simplified98.8%
Final simplification98.8%
(FPCore (a b)
:precision binary64
(if (<= a -6.9e+16)
(+ -1.0 (* (* a a) (+ (* a a) (* (* b b) 2.0))))
(if (<= a 1e+19)
(+ -1.0 (* b (* b (+ 12.0 (* b b)))))
(+ -1.0 (* (* a a) (+ (* a a) (* b b)))))))
double code(double a, double b) {
double tmp;
if (a <= -6.9e+16) {
tmp = -1.0 + ((a * a) * ((a * a) + ((b * b) * 2.0)));
} else if (a <= 1e+19) {
tmp = -1.0 + (b * (b * (12.0 + (b * b))));
} else {
tmp = -1.0 + ((a * a) * ((a * a) + (b * b)));
}
return tmp;
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-6.9d+16)) then
tmp = (-1.0d0) + ((a * a) * ((a * a) + ((b * b) * 2.0d0)))
else if (a <= 1d+19) then
tmp = (-1.0d0) + (b * (b * (12.0d0 + (b * b))))
else
tmp = (-1.0d0) + ((a * a) * ((a * a) + (b * b)))
end if
code = tmp
end function
public static double code(double a, double b) {
double tmp;
if (a <= -6.9e+16) {
tmp = -1.0 + ((a * a) * ((a * a) + ((b * b) * 2.0)));
} else if (a <= 1e+19) {
tmp = -1.0 + (b * (b * (12.0 + (b * b))));
} else {
tmp = -1.0 + ((a * a) * ((a * a) + (b * b)));
}
return tmp;
}
def code(a, b): tmp = 0 if a <= -6.9e+16: tmp = -1.0 + ((a * a) * ((a * a) + ((b * b) * 2.0))) elif a <= 1e+19: tmp = -1.0 + (b * (b * (12.0 + (b * b)))) else: tmp = -1.0 + ((a * a) * ((a * a) + (b * b))) return tmp
function code(a, b) tmp = 0.0 if (a <= -6.9e+16) tmp = Float64(-1.0 + Float64(Float64(a * a) * Float64(Float64(a * a) + Float64(Float64(b * b) * 2.0)))); elseif (a <= 1e+19) tmp = Float64(-1.0 + Float64(b * Float64(b * Float64(12.0 + Float64(b * b))))); else tmp = Float64(-1.0 + Float64(Float64(a * a) * Float64(Float64(a * a) + Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (a <= -6.9e+16) tmp = -1.0 + ((a * a) * ((a * a) + ((b * b) * 2.0))); elseif (a <= 1e+19) tmp = -1.0 + (b * (b * (12.0 + (b * b)))); else tmp = -1.0 + ((a * a) * ((a * a) + (b * b))); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[a, -6.9e+16], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1e+19], N[(-1.0 + N[(b * N[(b * N[(12.0 + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.9 \cdot 10^{+16}:\\
\;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(a \cdot a + \left(b \cdot b\right) \cdot 2\right)\\
\mathbf{elif}\;a \leq 10^{+19}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \left(12 + b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot b\right)\\
\end{array}
\end{array}
if a < -6.9e16Initial program 68.4%
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
Simplified68.4%
Taylor expanded in b around 0
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--.f6499.9%
Simplified99.9%
Taylor expanded in a around 0
Simplified99.9%
Taylor expanded in b around 0
associate--l+N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-+r-N/A
metadata-evalN/A
pow-sqrN/A
distribute-lft-inN/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
Simplified98.1%
if -6.9e16 < a < 1e19Initial program 99.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
Simplified99.1%
Taylor expanded in b around 0
Simplified99.9%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6496.8%
Simplified96.8%
if 1e19 < a Initial program 34.3%
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
Simplified34.3%
Taylor expanded in b around 0
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--.f6434.3%
Simplified34.3%
Taylor expanded in a around 0
Simplified99.8%
Taylor expanded in a around inf
unpow2N/A
*-lowering-*.f6499.8%
Simplified99.8%
Final simplification97.8%
(FPCore (a b)
:precision binary64
(let* ((t_0 (+ -1.0 (* (* a a) (+ (* a a) (* b b))))))
(if (<= a -6e+19)
t_0
(if (<= a 1e+19) (+ -1.0 (* b (* b (+ 12.0 (* b b))))) t_0))))
double code(double a, double b) {
double t_0 = -1.0 + ((a * a) * ((a * a) + (b * b)));
double tmp;
if (a <= -6e+19) {
tmp = t_0;
} else if (a <= 1e+19) {
tmp = -1.0 + (b * (b * (12.0 + (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 = (-1.0d0) + ((a * a) * ((a * a) + (b * b)))
if (a <= (-6d+19)) then
tmp = t_0
else if (a <= 1d+19) then
tmp = (-1.0d0) + (b * (b * (12.0d0 + (b * b))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b) {
double t_0 = -1.0 + ((a * a) * ((a * a) + (b * b)));
double tmp;
if (a <= -6e+19) {
tmp = t_0;
} else if (a <= 1e+19) {
tmp = -1.0 + (b * (b * (12.0 + (b * b))));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = -1.0 + ((a * a) * ((a * a) + (b * b))) tmp = 0 if a <= -6e+19: tmp = t_0 elif a <= 1e+19: tmp = -1.0 + (b * (b * (12.0 + (b * b)))) else: tmp = t_0 return tmp
function code(a, b) t_0 = Float64(-1.0 + Float64(Float64(a * a) * Float64(Float64(a * a) + Float64(b * b)))) tmp = 0.0 if (a <= -6e+19) tmp = t_0; elseif (a <= 1e+19) tmp = Float64(-1.0 + Float64(b * Float64(b * Float64(12.0 + Float64(b * b))))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b) t_0 = -1.0 + ((a * a) * ((a * a) + (b * b))); tmp = 0.0; if (a <= -6e+19) tmp = t_0; elseif (a <= 1e+19) tmp = -1.0 + (b * (b * (12.0 + (b * b)))); else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_] := Block[{t$95$0 = N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e+19], t$95$0, If[LessEqual[a, 1e+19], N[(-1.0 + N[(b * N[(b * N[(12.0 + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 + \left(a \cdot a\right) \cdot \left(a \cdot a + b \cdot b\right)\\
\mathbf{if}\;a \leq -6 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 10^{+19}:\\
\;\;\;\;-1 + b \cdot \left(b \cdot \left(12 + b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -6e19 or 1e19 < a Initial program 53.7%
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
Simplified53.7%
Taylor expanded in b around 0
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--.f6471.7%
Simplified71.7%
Taylor expanded in a around 0
Simplified99.8%
Taylor expanded in a around inf
unpow2N/A
*-lowering-*.f6498.7%
Simplified98.7%
if -6e19 < a < 1e19Initial program 99.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
Simplified99.1%
Taylor expanded in b around 0
Simplified99.9%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6496.8%
Simplified96.8%
Final simplification97.7%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+85) (+ -1.0 (* (+ 4.0 (* a (+ a -4.0))) (* a a))) (* b (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+85) {
tmp = -1.0 + ((4.0 + (a * (a + -4.0))) * (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) <= 1d+85) then
tmp = (-1.0d0) + ((4.0d0 + (a * (a + (-4.0d0)))) * (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) <= 1e+85) {
tmp = -1.0 + ((4.0 + (a * (a + -4.0))) * (a * a));
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e+85: tmp = -1.0 + ((4.0 + (a * (a + -4.0))) * (a * a)) else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+85) tmp = Float64(-1.0 + Float64(Float64(4.0 + Float64(a * Float64(a + -4.0))) * 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) <= 1e+85) tmp = -1.0 + ((4.0 + (a * (a + -4.0))) * (a * a)); else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+85], N[(-1.0 + N[(N[(4.0 + N[(a * N[(a + -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 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 10^{+85}:\\
\;\;\;\;-1 + \left(4 + a \cdot \left(a + -4\right)\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 1e85Initial program 85.6%
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
Simplified85.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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.7%
Simplified95.7%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
if 1e85 < (*.f64 b b) Initial program 62.3%
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
Simplified62.3%
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-*.f6495.4%
Simplified95.4%
Final simplification95.6%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+85) (+ -1.0 (* (* a a) (+ 4.0 (* a a)))) (* b (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+85) {
tmp = -1.0 + ((a * a) * (4.0 + (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) <= 1d+85) then
tmp = (-1.0d0) + ((a * a) * (4.0d0 + (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) <= 1e+85) {
tmp = -1.0 + ((a * a) * (4.0 + (a * a)));
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e+85: tmp = -1.0 + ((a * a) * (4.0 + (a * a))) else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+85) tmp = Float64(-1.0 + Float64(Float64(a * a) * Float64(4.0 + 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) <= 1e+85) tmp = -1.0 + ((a * a) * (4.0 + (a * a))); else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+85], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * N[(4.0 + N[(a * a), $MachinePrecision]), $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 10^{+85}:\\
\;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(4 + a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 1e85Initial program 85.6%
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
Simplified85.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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.7%
Simplified95.7%
Taylor expanded in a around 0
Simplified94.5%
if 1e85 < (*.f64 b b) Initial program 62.3%
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
Simplified62.3%
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-*.f6495.4%
Simplified95.4%
Final simplification94.9%
(FPCore (a b)
:precision binary64
(let* ((t_0 (* a (* a (* a a)))))
(if (<= a -1.75e+17)
t_0
(if (<= a 1720000000.0) (+ -1.0 (* b (* b 12.0))) t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -1.75e+17) {
tmp = t_0;
} else if (a <= 1720000000.0) {
tmp = -1.0 + (b * (b * 12.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.75d+17)) then
tmp = t_0
else if (a <= 1720000000.0d0) then
tmp = (-1.0d0) + (b * (b * 12.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.75e+17) {
tmp = t_0;
} else if (a <= 1720000000.0) {
tmp = -1.0 + (b * (b * 12.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -1.75e+17: tmp = t_0 elif a <= 1720000000.0: tmp = -1.0 + (b * (b * 12.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.75e+17) tmp = t_0; elseif (a <= 1720000000.0) tmp = Float64(-1.0 + Float64(b * Float64(b * 12.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.75e+17) tmp = t_0; elseif (a <= 1720000000.0) tmp = -1.0 + (b * (b * 12.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.75e+17], t$95$0, If[LessEqual[a, 1720000000.0], N[(-1.0 + N[(b * N[(b * 12.0), $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 -1.75 \cdot 10^{+17}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1720000000:\\
\;\;\;\;-1 + b \cdot \left(b \cdot 12\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.75e17 or 1.72e9 < a Initial program 54.5%
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
Simplified54.5%
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-*.f6493.4%
Simplified93.4%
if -1.75e17 < a < 1.72e9Initial program 99.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
Simplified99.1%
Taylor expanded in b around 0
Simplified99.9%
Taylor expanded in a around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6497.5%
Simplified97.5%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.3%
Simplified75.3%
(FPCore (a b) :precision binary64 (let* ((t_0 (* a (* a (* a a))))) (if (<= a -0.41) t_0 (if (<= a 2.3e-5) -1.0 t_0))))
double code(double a, double b) {
double t_0 = a * (a * (a * a));
double tmp;
if (a <= -0.41) {
tmp = t_0;
} else if (a <= 2.3e-5) {
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.41d0)) then
tmp = t_0
else if (a <= 2.3d-5) 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.41) {
tmp = t_0;
} else if (a <= 2.3e-5) {
tmp = -1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b): t_0 = a * (a * (a * a)) tmp = 0 if a <= -0.41: tmp = t_0 elif a <= 2.3e-5: 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.41) tmp = t_0; elseif (a <= 2.3e-5) 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.41) tmp = t_0; elseif (a <= 2.3e-5) 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.41], t$95$0, If[LessEqual[a, 2.3e-5], -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.41:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-5}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.409999999999999976 or 2.3e-5 < a Initial program 56.3%
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
Simplified56.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-*.f6488.7%
Simplified88.7%
if -0.409999999999999976 < a < 2.3e-5Initial program 99.9%
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
Simplified99.9%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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--.f6455.4%
Simplified55.4%
Taylor expanded in a around 0
Simplified55.1%
(FPCore (a b) :precision binary64 (let* ((t_0 (+ (* a a) (* b b)))) (+ -1.0 (* t_0 t_0))))
double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return -1.0 + (t_0 * t_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 = (-1.0d0) + (t_0 * t_0)
end function
public static double code(double a, double b) {
double t_0 = (a * a) + (b * b);
return -1.0 + (t_0 * t_0);
}
def code(a, b): t_0 = (a * a) + (b * b) return -1.0 + (t_0 * t_0)
function code(a, b) t_0 = Float64(Float64(a * a) + Float64(b * b)) return Float64(-1.0 + Float64(t_0 * t_0)) end
function tmp = code(a, b) t_0 = (a * a) + (b * b); tmp = -1.0 + (t_0 * t_0); end
code[a_, b_] := Block[{t$95$0 = N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, N[(-1.0 + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot a + b \cdot b\\
-1 + t\_0 \cdot t\_0
\end{array}
\end{array}
Initial program 76.4%
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
Simplified76.4%
Taylor expanded in b around 0
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--.f6485.5%
Simplified85.5%
Taylor expanded in a around 0
Simplified98.7%
Final simplification98.7%
(FPCore (a b) :precision binary64 (if (<= (* b b) 1e+85) (+ -1.0 (* (* a a) (* a a))) (* b (* b (* b b)))))
double code(double a, double b) {
double tmp;
if ((b * b) <= 1e+85) {
tmp = -1.0 + ((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) <= 1d+85) then
tmp = (-1.0d0) + ((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) <= 1e+85) {
tmp = -1.0 + ((a * a) * (a * a));
} else {
tmp = b * (b * (b * b));
}
return tmp;
}
def code(a, b): tmp = 0 if (b * b) <= 1e+85: tmp = -1.0 + ((a * a) * (a * a)) else: tmp = b * (b * (b * b)) return tmp
function code(a, b) tmp = 0.0 if (Float64(b * b) <= 1e+85) tmp = Float64(-1.0 + Float64(Float64(a * 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) <= 1e+85) tmp = -1.0 + ((a * a) * (a * a)); else tmp = b * (b * (b * b)); end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[N[(b * b), $MachinePrecision], 1e+85], N[(-1.0 + N[(N[(a * a), $MachinePrecision] * 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 10^{+85}:\\
\;\;\;\;-1 + \left(a \cdot a\right) \cdot \left(a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 b b) < 1e85Initial program 85.6%
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
Simplified85.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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.7%
Simplified95.7%
Taylor expanded in a around inf
unpow2N/A
*-lowering-*.f6494.3%
Simplified94.3%
if 1e85 < (*.f64 b b) Initial program 62.3%
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
Simplified62.3%
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-*.f6495.4%
Simplified95.4%
(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.4%
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
Simplified76.4%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
+-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--.f6473.9%
Simplified73.9%
Taylor expanded in a around 0
Simplified25.8%
herbie shell --seed 2024161
(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))