
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 98.0%
associate--l+98.0%
associate-+l+98.0%
fma-def98.8%
associate-+l-98.8%
associate-*l/98.8%
fma-neg98.8%
neg-sub098.8%
div098.8%
associate-+l-98.8%
associate-/l*98.8%
div-sub98.8%
neg-sub098.8%
associate-/r/98.8%
fma-def98.8%
neg-mul-198.8%
*-commutative98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (+ c (fma a (* b -0.25) (fma 0.0625 (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + fma(a, (b * -0.25), fma(0.0625, (z * t), (x * y)));
}
function code(x, y, z, t, a, b, c) return Float64(c + fma(a, Float64(b * -0.25), fma(0.0625, Float64(z * t), Float64(x * y)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(a * N[(b * -0.25), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, z \cdot t, x \cdot y\right)\right)
\end{array}
Initial program 98.0%
Taylor expanded in x around 0 98.0%
cancel-sign-sub-inv98.0%
metadata-eval98.0%
+-commutative98.0%
*-commutative98.0%
associate-*r*98.0%
+-commutative98.0%
associate-*r*98.0%
*-commutative98.0%
*-commutative98.0%
fma-def98.4%
fma-def99.2%
fma-def98.8%
+-commutative98.8%
associate-*r*98.8%
*-commutative98.8%
fma-def98.8%
*-commutative98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (+ (+ (* x y) (fma a (* b -0.25) c)) (* z (* t 0.0625))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((x * y) + fma(a, (b * -0.25), c)) + (z * (t * 0.0625));
}
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(x * y) + fma(a, Float64(b * -0.25), c)) + Float64(z * Float64(t * 0.0625))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(x * y), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + z \cdot \left(t \cdot 0.0625\right)
\end{array}
Initial program 98.0%
associate--l+98.0%
associate-+l+98.0%
fma-def98.8%
associate-+l-98.8%
associate-*l/98.8%
fma-neg98.8%
neg-sub098.8%
div098.8%
associate-+l-98.8%
associate-/l*98.8%
div-sub98.8%
neg-sub098.8%
associate-/r/98.8%
fma-def98.8%
neg-mul-198.8%
*-commutative98.8%
associate-/l*98.8%
metadata-eval98.8%
Simplified98.8%
fma-udef98.0%
fma-udef98.0%
associate-/r/98.0%
fma-udef98.0%
associate-*l/98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+r+98.0%
div-inv98.0%
fma-def98.0%
clear-num98.0%
div-inv98.0%
metadata-eval98.0%
div-inv98.0%
associate-*l*98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (* (/ z 16.0) t)) (+ c (/ a (/ -4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, ((z / 16.0) * t)) + (c + (a / (-4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(Float64(z / 16.0) * t)) + Float64(c + Float64(a / Float64(-4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right)
\end{array}
Initial program 98.0%
associate-+l-98.0%
sub-neg98.0%
fma-def98.4%
associate-*l/98.4%
neg-sub098.4%
div098.4%
associate-+l-98.4%
associate-/l*98.4%
div-sub98.4%
neg-sub098.4%
associate-/r/98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.4%
associate-/r/98.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* -0.25 (* a b))))
(t_2 (* 0.0625 (* z t)))
(t_3 (+ c (* x y))))
(if (<= (* x y) -3.2e+37)
t_3
(if (<= (* x y) -4.4e-111)
t_1
(if (<= (* x y) 3.3e+66)
(+ c t_2)
(if (<= (* x y) 2.5e+101) t_1 (if (<= (* x y) 4e+123) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (-0.25 * (a * b));
double t_2 = 0.0625 * (z * t);
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -3.2e+37) {
tmp = t_3;
} else if ((x * y) <= -4.4e-111) {
tmp = t_1;
} else if ((x * y) <= 3.3e+66) {
tmp = c + t_2;
} else if ((x * y) <= 2.5e+101) {
tmp = t_1;
} else if ((x * y) <= 4e+123) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + ((-0.25d0) * (a * b))
t_2 = 0.0625d0 * (z * t)
t_3 = c + (x * y)
if ((x * y) <= (-3.2d+37)) then
tmp = t_3
else if ((x * y) <= (-4.4d-111)) then
tmp = t_1
else if ((x * y) <= 3.3d+66) then
tmp = c + t_2
else if ((x * y) <= 2.5d+101) then
tmp = t_1
else if ((x * y) <= 4d+123) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (-0.25 * (a * b));
double t_2 = 0.0625 * (z * t);
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -3.2e+37) {
tmp = t_3;
} else if ((x * y) <= -4.4e-111) {
tmp = t_1;
} else if ((x * y) <= 3.3e+66) {
tmp = c + t_2;
} else if ((x * y) <= 2.5e+101) {
tmp = t_1;
} else if ((x * y) <= 4e+123) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (-0.25 * (a * b)) t_2 = 0.0625 * (z * t) t_3 = c + (x * y) tmp = 0 if (x * y) <= -3.2e+37: tmp = t_3 elif (x * y) <= -4.4e-111: tmp = t_1 elif (x * y) <= 3.3e+66: tmp = c + t_2 elif (x * y) <= 2.5e+101: tmp = t_1 elif (x * y) <= 4e+123: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(-0.25 * Float64(a * b))) t_2 = Float64(0.0625 * Float64(z * t)) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.2e+37) tmp = t_3; elseif (Float64(x * y) <= -4.4e-111) tmp = t_1; elseif (Float64(x * y) <= 3.3e+66) tmp = Float64(c + t_2); elseif (Float64(x * y) <= 2.5e+101) tmp = t_1; elseif (Float64(x * y) <= 4e+123) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (-0.25 * (a * b)); t_2 = 0.0625 * (z * t); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -3.2e+37) tmp = t_3; elseif ((x * y) <= -4.4e-111) tmp = t_1; elseif ((x * y) <= 3.3e+66) tmp = c + t_2; elseif ((x * y) <= 2.5e+101) tmp = t_1; elseif ((x * y) <= 4e+123) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.2e+37], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -4.4e-111], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.3e+66], N[(c + t$95$2), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+101], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+123], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + -0.25 \cdot \left(a \cdot b\right)\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+37}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -4.4 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+66}:\\
\;\;\;\;c + t_2\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+123}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -3.20000000000000014e37 or 3.99999999999999991e123 < (*.f64 x y) Initial program 94.8%
Taylor expanded in x around inf 70.8%
if -3.20000000000000014e37 < (*.f64 x y) < -4.4e-111 or 3.3000000000000001e66 < (*.f64 x y) < 2.49999999999999994e101Initial program 99.9%
Taylor expanded in a around inf 79.7%
if -4.4e-111 < (*.f64 x y) < 3.3000000000000001e66Initial program 100.0%
Taylor expanded in z around inf 73.9%
if 2.49999999999999994e101 < (*.f64 x y) < 3.99999999999999991e123Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
fma-def100.0%
associate-+l-100.0%
associate-*l/100.0%
fma-neg100.0%
neg-sub0100.0%
div0100.0%
associate-+l-100.0%
associate-/l*100.0%
div-sub100.0%
neg-sub0100.0%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-/r/100.0%
fma-udef100.0%
associate-*l/100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
div-inv100.0%
fma-def100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 69.0%
Final simplification73.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (+ c (* -0.25 (* a b)))))
(if (<= (* a b) -2.05e+116)
t_2
(if (<= (* a b) -8e+82)
t_1
(if (<= (* a b) -2.8e+60)
(* 0.0625 (* z t))
(if (<= (* a b) 1.65e+74) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = c + (-0.25 * (a * b));
double tmp;
if ((a * b) <= -2.05e+116) {
tmp = t_2;
} else if ((a * b) <= -8e+82) {
tmp = t_1;
} else if ((a * b) <= -2.8e+60) {
tmp = 0.0625 * (z * t);
} else if ((a * b) <= 1.65e+74) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + ((-0.25d0) * (a * b))
if ((a * b) <= (-2.05d+116)) then
tmp = t_2
else if ((a * b) <= (-8d+82)) then
tmp = t_1
else if ((a * b) <= (-2.8d+60)) then
tmp = 0.0625d0 * (z * t)
else if ((a * b) <= 1.65d+74) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double t_2 = c + (-0.25 * (a * b));
double tmp;
if ((a * b) <= -2.05e+116) {
tmp = t_2;
} else if ((a * b) <= -8e+82) {
tmp = t_1;
} else if ((a * b) <= -2.8e+60) {
tmp = 0.0625 * (z * t);
} else if ((a * b) <= 1.65e+74) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = c + (-0.25 * (a * b)) tmp = 0 if (a * b) <= -2.05e+116: tmp = t_2 elif (a * b) <= -8e+82: tmp = t_1 elif (a * b) <= -2.8e+60: tmp = 0.0625 * (z * t) elif (a * b) <= 1.65e+74: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(c + Float64(-0.25 * Float64(a * b))) tmp = 0.0 if (Float64(a * b) <= -2.05e+116) tmp = t_2; elseif (Float64(a * b) <= -8e+82) tmp = t_1; elseif (Float64(a * b) <= -2.8e+60) tmp = Float64(0.0625 * Float64(z * t)); elseif (Float64(a * b) <= 1.65e+74) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); t_2 = c + (-0.25 * (a * b)); tmp = 0.0; if ((a * b) <= -2.05e+116) tmp = t_2; elseif ((a * b) <= -8e+82) tmp = t_1; elseif ((a * b) <= -2.8e+60) tmp = 0.0625 * (z * t); elseif ((a * b) <= 1.65e+74) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.05e+116], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -8e+82], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.8e+60], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.65e+74], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + -0.25 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -8 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -2.8 \cdot 10^{+60}:\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0499999999999999e116 or 1.6500000000000001e74 < (*.f64 a b) Initial program 96.2%
Taylor expanded in a around inf 75.5%
if -2.0499999999999999e116 < (*.f64 a b) < -7.9999999999999997e82 or -2.8e60 < (*.f64 a b) < 1.6500000000000001e74Initial program 98.8%
Taylor expanded in x around inf 64.6%
if -7.9999999999999997e82 < (*.f64 a b) < -2.8e60Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
fma-def100.0%
associate-+l-100.0%
associate-*l/100.0%
fma-neg100.0%
neg-sub0100.0%
div0100.0%
associate-+l-100.0%
associate-/l*100.0%
div-sub100.0%
neg-sub0100.0%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-/r/100.0%
fma-udef100.0%
associate-*l/100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
div-inv100.0%
fma-def100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 75.5%
Final simplification68.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -9.5e+37)
(+ c (* x y))
(if (<= (* x y) -2.8e-110)
(+ c (* -0.25 (* a b)))
(if (<= (* x y) 5e-33)
(+ c (* 0.0625 (* z t)))
(+ (* x y) (* z (* t 0.0625)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -9.5e+37) {
tmp = c + (x * y);
} else if ((x * y) <= -2.8e-110) {
tmp = c + (-0.25 * (a * b));
} else if ((x * y) <= 5e-33) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = (x * y) + (z * (t * 0.0625));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-9.5d+37)) then
tmp = c + (x * y)
else if ((x * y) <= (-2.8d-110)) then
tmp = c + ((-0.25d0) * (a * b))
else if ((x * y) <= 5d-33) then
tmp = c + (0.0625d0 * (z * t))
else
tmp = (x * y) + (z * (t * 0.0625d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -9.5e+37) {
tmp = c + (x * y);
} else if ((x * y) <= -2.8e-110) {
tmp = c + (-0.25 * (a * b));
} else if ((x * y) <= 5e-33) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = (x * y) + (z * (t * 0.0625));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -9.5e+37: tmp = c + (x * y) elif (x * y) <= -2.8e-110: tmp = c + (-0.25 * (a * b)) elif (x * y) <= 5e-33: tmp = c + (0.0625 * (z * t)) else: tmp = (x * y) + (z * (t * 0.0625)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -9.5e+37) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= -2.8e-110) tmp = Float64(c + Float64(-0.25 * Float64(a * b))); elseif (Float64(x * y) <= 5e-33) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(z * Float64(t * 0.0625))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -9.5e+37) tmp = c + (x * y); elseif ((x * y) <= -2.8e-110) tmp = c + (-0.25 * (a * b)); elseif ((x * y) <= 5e-33) tmp = c + (0.0625 * (z * t)); else tmp = (x * y) + (z * (t * 0.0625)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+37], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-110], N[(c + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-33], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+37}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-110}:\\
\;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-33}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot \left(t \cdot 0.0625\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.4999999999999995e37Initial program 94.3%
Taylor expanded in x around inf 71.8%
if -9.4999999999999995e37 < (*.f64 x y) < -2.8e-110Initial program 99.9%
Taylor expanded in a around inf 83.7%
if -2.8e-110 < (*.f64 x y) < 5.00000000000000028e-33Initial program 100.0%
Taylor expanded in z around inf 76.0%
if 5.00000000000000028e-33 < (*.f64 x y) Initial program 97.4%
associate--l+97.4%
associate-+l+97.4%
fma-def98.7%
associate-+l-98.7%
associate-*l/98.7%
fma-neg98.7%
neg-sub098.7%
div098.7%
associate-+l-98.7%
associate-/l*98.7%
div-sub98.7%
neg-sub098.7%
associate-/r/98.7%
fma-def98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
metadata-eval98.7%
Simplified98.7%
fma-udef97.4%
fma-udef97.4%
associate-/r/97.4%
fma-udef97.4%
associate-*l/97.4%
associate-+r+97.4%
+-commutative97.4%
associate-+r+97.4%
div-inv97.4%
fma-def97.4%
clear-num97.4%
div-inv97.4%
metadata-eval97.4%
div-inv97.4%
associate-*l*97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in x around inf 67.2%
Final simplification73.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -9.8e+42)
t_1
(if (<= (* x y) -4e-109)
(+ c (* -0.25 (* a b)))
(if (<= (* x y) 7.9e+68) (+ c (* 0.0625 (* z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -9.8e+42) {
tmp = t_1;
} else if ((x * y) <= -4e-109) {
tmp = c + (-0.25 * (a * b));
} else if ((x * y) <= 7.9e+68) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-9.8d+42)) then
tmp = t_1
else if ((x * y) <= (-4d-109)) then
tmp = c + ((-0.25d0) * (a * b))
else if ((x * y) <= 7.9d+68) then
tmp = c + (0.0625d0 * (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -9.8e+42) {
tmp = t_1;
} else if ((x * y) <= -4e-109) {
tmp = c + (-0.25 * (a * b));
} else if ((x * y) <= 7.9e+68) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -9.8e+42: tmp = t_1 elif (x * y) <= -4e-109: tmp = c + (-0.25 * (a * b)) elif (x * y) <= 7.9e+68: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -9.8e+42) tmp = t_1; elseif (Float64(x * y) <= -4e-109) tmp = Float64(c + Float64(-0.25 * Float64(a * b))); elseif (Float64(x * y) <= 7.9e+68) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -9.8e+42) tmp = t_1; elseif ((x * y) <= -4e-109) tmp = c + (-0.25 * (a * b)); elseif ((x * y) <= 7.9e+68) tmp = c + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9.8e+42], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4e-109], N[(c + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.9e+68], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -9.8 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-109}:\\
\;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \cdot y \leq 7.9 \cdot 10^{+68}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -9.8000000000000004e42 or 7.9e68 < (*.f64 x y) Initial program 95.2%
Taylor expanded in z around 0 83.3%
Taylor expanded in c around 0 72.2%
if -9.8000000000000004e42 < (*.f64 x y) < -4e-109Initial program 99.9%
Taylor expanded in a around inf 81.2%
if -4e-109 < (*.f64 x y) < 7.9e68Initial program 100.0%
Taylor expanded in z around inf 73.5%
Final simplification73.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -2.05e+116) (not (<= (* a b) 1.5e+74)))
(- (+ c t_1) (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2.05e+116) || !((a * b) <= 1.5e+74)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((a * b) <= (-2.05d+116)) .or. (.not. ((a * b) <= 1.5d+74))) then
tmp = (c + t_1) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -2.05e+116) || !((a * b) <= 1.5e+74)) {
tmp = (c + t_1) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -2.05e+116) or not ((a * b) <= 1.5e+74): tmp = (c + t_1) - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -2.05e+116) || !(Float64(a * b) <= 1.5e+74)) tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((a * b) <= -2.05e+116) || ~(((a * b) <= 1.5e+74))) tmp = (c + t_1) - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.05e+116], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.5e+74]], $MachinePrecision]], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116} \lor \neg \left(a \cdot b \leq 1.5 \cdot 10^{+74}\right):\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0499999999999999e116 or 1.5e74 < (*.f64 a b) Initial program 96.2%
Taylor expanded in x around 0 90.7%
if -2.0499999999999999e116 < (*.f64 a b) < 1.5e74Initial program 98.8%
Taylor expanded in a around 0 93.5%
Final simplification92.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* a b) -1e+165) (not (<= (* a b) 5e+234)))
(- t_1 (* (* a b) 0.25))
(+ c (+ (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -1e+165) || !((a * b) <= 5e+234)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((a * b) <= (-1d+165)) .or. (.not. ((a * b) <= 5d+234))) then
tmp = t_1 - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -1e+165) || !((a * b) <= 5e+234)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -1e+165) or not ((a * b) <= 5e+234): tmp = t_1 - ((a * b) * 0.25) else: tmp = c + ((x * y) + t_1) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -1e+165) || !(Float64(a * b) <= 5e+234)) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((a * b) <= -1e+165) || ~(((a * b) <= 5e+234))) tmp = t_1 - ((a * b) * 0.25); else tmp = c + ((x * y) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+165], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+234]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+165} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+234}\right):\\
\;\;\;\;t_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999899e164 or 5.0000000000000003e234 < (*.f64 a b) Initial program 94.6%
Taylor expanded in x around 0 94.6%
Taylor expanded in c around 0 90.9%
if -9.99999999999999899e164 < (*.f64 a b) < 5.0000000000000003e234Initial program 99.0%
Taylor expanded in a around 0 89.3%
Final simplification89.7%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2.05e+116)
(+ c (* -0.25 (* a b)))
(if (<= (* a b) 2e+239)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2.05e+116) {
tmp = c + (-0.25 * (a * b));
} else if ((a * b) <= 2e+239) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-2.05d+116)) then
tmp = c + ((-0.25d0) * (a * b))
else if ((a * b) <= 2d+239) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - ((a * b) * 0.25d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2.05e+116) {
tmp = c + (-0.25 * (a * b));
} else if ((a * b) <= 2e+239) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2.05e+116: tmp = c + (-0.25 * (a * b)) elif (a * b) <= 2e+239: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2.05e+116) tmp = Float64(c + Float64(-0.25 * Float64(a * b))); elseif (Float64(a * b) <= 2e+239) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -2.05e+116) tmp = c + (-0.25 * (a * b)); elseif ((a * b) <= 2e+239) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.05e+116], N[(c + N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+239], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.05 \cdot 10^{+116}:\\
\;\;\;\;c + -0.25 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+239}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0499999999999999e116Initial program 94.4%
Taylor expanded in a around inf 85.3%
if -2.0499999999999999e116 < (*.f64 a b) < 1.99999999999999998e239Initial program 99.0%
Taylor expanded in a around 0 90.3%
if 1.99999999999999998e239 < (*.f64 a b) Initial program 95.6%
Taylor expanded in z around 0 87.5%
Taylor expanded in c around 0 84.6%
Final simplification89.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* a b) -1e+165)
(- t_2 t_1)
(if (<= (* a b) 1e+66) (+ c (+ (* x y) t_2)) (- (+ c (* x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+165) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1e+66) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((a * b) <= (-1d+165)) then
tmp = t_2 - t_1
else if ((a * b) <= 1d+66) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + (x * y)) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((a * b) <= -1e+165) {
tmp = t_2 - t_1;
} else if ((a * b) <= 1e+66) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + (x * y)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) * 0.25 t_2 = 0.0625 * (z * t) tmp = 0 if (a * b) <= -1e+165: tmp = t_2 - t_1 elif (a * b) <= 1e+66: tmp = c + ((x * y) + t_2) else: tmp = (c + (x * y)) - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1e+165) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 1e+66) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + Float64(x * y)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) * 0.25; t_2 = 0.0625 * (z * t); tmp = 0.0; if ((a * b) <= -1e+165) tmp = t_2 - t_1; elseif ((a * b) <= 1e+66) tmp = c + ((x * y) + t_2); else tmp = (c + (x * y)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+165], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+66], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+165}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{elif}\;a \cdot b \leq 10^{+66}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999899e164Initial program 93.5%
Taylor expanded in x around 0 96.8%
Taylor expanded in c around 0 92.5%
if -9.99999999999999899e164 < (*.f64 a b) < 9.99999999999999945e65Initial program 98.9%
Taylor expanded in a around 0 92.3%
if 9.99999999999999945e65 < (*.f64 a b) Initial program 97.8%
Taylor expanded in z around 0 78.7%
Final simplification89.7%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - (a / (4.0 / b)));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + (((x * y) + ((z * t) / 16.0d0)) - (a / (4.0d0 / b)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - (a / (4.0 / b)));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - (a / (4.0 / b)))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(a / Float64(4.0 / b)))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - (a / (4.0 / b))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 98.0%
associate-/l*98.0%
associate-/r/98.0%
Applied egg-rr98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -5e-130) (not (<= t 440000000000.0))) (* 0.0625 (* z t)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -5e-130) || !(t <= 440000000000.0)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((t <= (-5d-130)) .or. (.not. (t <= 440000000000.0d0))) then
tmp = 0.0625d0 * (z * t)
else
tmp = c
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -5e-130) || !(t <= 440000000000.0)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -5e-130) or not (t <= 440000000000.0): tmp = 0.0625 * (z * t) else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -5e-130) || !(t <= 440000000000.0)) tmp = Float64(0.0625 * Float64(z * t)); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((t <= -5e-130) || ~((t <= 440000000000.0))) tmp = 0.0625 * (z * t); else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -5e-130], N[Not[LessEqual[t, 440000000000.0]], $MachinePrecision]], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-130} \lor \neg \left(t \leq 440000000000\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if t < -4.9999999999999996e-130 or 4.4e11 < t Initial program 98.0%
associate--l+98.0%
associate-+l+98.0%
fma-def98.7%
associate-+l-98.7%
associate-*l/98.7%
fma-neg98.7%
neg-sub098.7%
div098.7%
associate-+l-98.7%
associate-/l*98.7%
div-sub98.7%
neg-sub098.7%
associate-/r/98.7%
fma-def98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
metadata-eval98.7%
Simplified98.7%
fma-udef98.1%
fma-udef98.1%
associate-/r/98.0%
fma-udef98.0%
associate-*l/98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+r+98.0%
div-inv98.0%
fma-def98.0%
clear-num98.1%
div-inv98.1%
metadata-eval98.1%
div-inv98.1%
associate-*l*98.1%
metadata-eval98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 40.8%
if -4.9999999999999996e-130 < t < 4.4e11Initial program 97.9%
Taylor expanded in c around inf 38.7%
Final simplification40.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.3e+157) (not (<= z 4.1e-16))) (* 0.0625 (* z t)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.3e+157) || !(z <= 4.1e-16)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-3.3d+157)) .or. (.not. (z <= 4.1d-16))) then
tmp = 0.0625d0 * (z * t)
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.3e+157) || !(z <= 4.1e-16)) {
tmp = 0.0625 * (z * t);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.3e+157) or not (z <= 4.1e-16): tmp = 0.0625 * (z * t) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.3e+157) || !(z <= 4.1e-16)) tmp = Float64(0.0625 * Float64(z * t)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((z <= -3.3e+157) || ~((z <= 4.1e-16))) tmp = 0.0625 * (z * t); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.3e+157], N[Not[LessEqual[z, 4.1e-16]], $MachinePrecision]], N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+157} \lor \neg \left(z \leq 4.1 \cdot 10^{-16}\right):\\
\;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if z < -3.3000000000000002e157 or 4.10000000000000006e-16 < z Initial program 98.0%
associate--l+98.0%
associate-+l+98.0%
fma-def99.0%
associate-+l-99.0%
associate-*l/99.0%
fma-neg99.0%
neg-sub099.0%
div099.0%
associate-+l-99.0%
associate-/l*99.0%
div-sub99.0%
neg-sub099.0%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
fma-udef98.0%
fma-udef98.0%
associate-/r/98.0%
fma-udef98.0%
associate-*l/98.0%
associate-+r+98.0%
+-commutative98.0%
associate-+r+98.0%
div-inv97.9%
fma-def97.9%
clear-num98.0%
div-inv98.0%
metadata-eval98.0%
div-inv98.0%
associate-*l*98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 51.6%
if -3.3000000000000002e157 < z < 4.10000000000000006e-16Initial program 98.0%
Taylor expanded in x around inf 56.6%
Final simplification54.7%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 98.0%
Taylor expanded in c around inf 25.0%
Final simplification25.0%
herbie shell --seed 2023301
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))