
(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 14 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 96.4%
associate-+l-96.4%
associate--l+96.4%
fma-def98.4%
associate-*l/98.4%
fma-neg99.6%
sub-neg99.6%
distribute-neg-in99.6%
remove-double-neg99.6%
associate-/l*99.6%
distribute-frac-neg99.6%
associate-/r/99.6%
fma-def99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (+ (* x y) (* (* z t) 0.0625))))
(if (<= (* a b) -2e+120)
(+ c (* a (* b -0.25)))
(if (<= (* a b) -2e-229)
t_2
(if (<= (* a b) 2e-220)
t_1
(if (<= (* a b) 5e-127)
t_2
(if (<= (* a b) 2e-58)
t_1
(if (<= (* a b) 2e+40)
t_2
(if (<= (* a b) 1e+114)
t_1
(- (* x y) (* (* a b) 0.25)))))))))))
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 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((a * b) <= -2e+120) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= -2e-229) {
tmp = t_2;
} else if ((a * b) <= 2e-220) {
tmp = t_1;
} else if ((a * b) <= 5e-127) {
tmp = t_2;
} else if ((a * b) <= 2e-58) {
tmp = t_1;
} else if ((a * b) <= 2e+40) {
tmp = t_2;
} else if ((a * b) <= 1e+114) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c + (x * y)
t_2 = (x * y) + ((z * t) * 0.0625d0)
if ((a * b) <= (-2d+120)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= (-2d-229)) then
tmp = t_2
else if ((a * b) <= 2d-220) then
tmp = t_1
else if ((a * b) <= 5d-127) then
tmp = t_2
else if ((a * b) <= 2d-58) then
tmp = t_1
else if ((a * b) <= 2d+40) then
tmp = t_2
else if ((a * b) <= 1d+114) then
tmp = t_1
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 t_1 = c + (x * y);
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((a * b) <= -2e+120) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= -2e-229) {
tmp = t_2;
} else if ((a * b) <= 2e-220) {
tmp = t_1;
} else if ((a * b) <= 5e-127) {
tmp = t_2;
} else if ((a * b) <= 2e-58) {
tmp = t_1;
} else if ((a * b) <= 2e+40) {
tmp = t_2;
} else if ((a * b) <= 1e+114) {
tmp = t_1;
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) t_2 = (x * y) + ((z * t) * 0.0625) tmp = 0 if (a * b) <= -2e+120: tmp = c + (a * (b * -0.25)) elif (a * b) <= -2e-229: tmp = t_2 elif (a * b) <= 2e-220: tmp = t_1 elif (a * b) <= 5e-127: tmp = t_2 elif (a * b) <= 2e-58: tmp = t_1 elif (a * b) <= 2e+40: tmp = t_2 elif (a * b) <= 1e+114: tmp = t_1 else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (Float64(a * b) <= -2e+120) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= -2e-229) tmp = t_2; elseif (Float64(a * b) <= 2e-220) tmp = t_1; elseif (Float64(a * b) <= 5e-127) tmp = t_2; elseif (Float64(a * b) <= 2e-58) tmp = t_1; elseif (Float64(a * b) <= 2e+40) tmp = t_2; elseif (Float64(a * b) <= 1e+114) tmp = t_1; 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) t_1 = c + (x * y); t_2 = (x * y) + ((z * t) * 0.0625); tmp = 0.0; if ((a * b) <= -2e+120) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= -2e-229) tmp = t_2; elseif ((a * b) <= 2e-220) tmp = t_1; elseif ((a * b) <= 5e-127) tmp = t_2; elseif ((a * b) <= 2e-58) tmp = t_1; elseif ((a * b) <= 2e+40) tmp = t_2; elseif ((a * b) <= 1e+114) tmp = t_1; else tmp = (x * y) - ((a * b) * 0.25); 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[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+120], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e-229], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e-220], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e-127], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e-58], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e+40], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1e+114], t$95$1, N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+120}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-229}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -2e120Initial program 92.2%
Taylor expanded in a around inf 86.5%
*-commutative86.5%
associate-*r*86.5%
Simplified86.5%
if -2e120 < (*.f64 a b) < -2.00000000000000014e-229 or 1.99999999999999998e-220 < (*.f64 a b) < 4.9999999999999997e-127 or 2.0000000000000001e-58 < (*.f64 a b) < 2.00000000000000006e40Initial program 99.9%
Taylor expanded in a around 0 94.9%
+-commutative94.9%
associate-*r*94.9%
*-commutative94.9%
*-commutative94.9%
+-commutative94.9%
associate-+l+94.9%
*-commutative94.9%
associate-*r*94.9%
*-commutative94.9%
fma-def95.0%
*-commutative95.0%
Simplified95.0%
Taylor expanded in c around 0 79.1%
if -2.00000000000000014e-229 < (*.f64 a b) < 1.99999999999999998e-220 or 4.9999999999999997e-127 < (*.f64 a b) < 2.0000000000000001e-58 or 2.00000000000000006e40 < (*.f64 a b) < 1e114Initial program 97.7%
Taylor expanded in x around inf 81.3%
if 1e114 < (*.f64 a b) Initial program 91.4%
Taylor expanded in z around 0 86.5%
Taylor expanded in c around 0 81.8%
Final simplification81.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* b (* a -0.25))))
(if (<= (* x y) -3.4e+121)
(* x y)
(if (<= (* x y) 1.15e-196)
c
(if (<= (* x y) 2.05e-42)
t_1
(if (<= (* x y) 35.0)
(* z (* t 0.0625))
(if (<= (* x y) 1.02e+62) t_1 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b * (a * -0.25);
double tmp;
if ((x * y) <= -3.4e+121) {
tmp = x * y;
} else if ((x * y) <= 1.15e-196) {
tmp = c;
} else if ((x * y) <= 2.05e-42) {
tmp = t_1;
} else if ((x * y) <= 35.0) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 1.02e+62) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
if ((x * y) <= (-3.4d+121)) then
tmp = x * y
else if ((x * y) <= 1.15d-196) then
tmp = c
else if ((x * y) <= 2.05d-42) then
tmp = t_1
else if ((x * y) <= 35.0d0) then
tmp = z * (t * 0.0625d0)
else if ((x * y) <= 1.02d+62) then
tmp = t_1
else
tmp = 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 t_1 = b * (a * -0.25);
double tmp;
if ((x * y) <= -3.4e+121) {
tmp = x * y;
} else if ((x * y) <= 1.15e-196) {
tmp = c;
} else if ((x * y) <= 2.05e-42) {
tmp = t_1;
} else if ((x * y) <= 35.0) {
tmp = z * (t * 0.0625);
} else if ((x * y) <= 1.02e+62) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b * (a * -0.25) tmp = 0 if (x * y) <= -3.4e+121: tmp = x * y elif (x * y) <= 1.15e-196: tmp = c elif (x * y) <= 2.05e-42: tmp = t_1 elif (x * y) <= 35.0: tmp = z * (t * 0.0625) elif (x * y) <= 1.02e+62: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b * Float64(a * -0.25)) tmp = 0.0 if (Float64(x * y) <= -3.4e+121) tmp = Float64(x * y); elseif (Float64(x * y) <= 1.15e-196) tmp = c; elseif (Float64(x * y) <= 2.05e-42) tmp = t_1; elseif (Float64(x * y) <= 35.0) tmp = Float64(z * Float64(t * 0.0625)); elseif (Float64(x * y) <= 1.02e+62) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b * (a * -0.25); tmp = 0.0; if ((x * y) <= -3.4e+121) tmp = x * y; elseif ((x * y) <= 1.15e-196) tmp = c; elseif ((x * y) <= 2.05e-42) tmp = t_1; elseif ((x * y) <= 35.0) tmp = z * (t * 0.0625); elseif ((x * y) <= 1.02e+62) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e+121], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-196], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.05e-42], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 35.0], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.02e+62], t$95$1, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -3.4 \cdot 10^{+121}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-196}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.05 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 35:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 1.02 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.4000000000000001e121 or 1.02000000000000002e62 < (*.f64 x y) Initial program 91.7%
Taylor expanded in z around 0 82.5%
Taylor expanded in c around 0 75.9%
Taylor expanded in x around inf 68.9%
if -3.4000000000000001e121 < (*.f64 x y) < 1.1500000000000001e-196Initial program 99.1%
Taylor expanded in c around inf 41.9%
if 1.1500000000000001e-196 < (*.f64 x y) < 2.0500000000000001e-42 or 35 < (*.f64 x y) < 1.02000000000000002e62Initial program 100.0%
Taylor expanded in z around 0 80.7%
Taylor expanded in c around 0 59.3%
Taylor expanded in x around 0 56.8%
associate-*r*56.8%
*-commutative56.8%
Simplified56.8%
if 2.0500000000000001e-42 < (*.f64 x y) < 35Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
associate-+l-99.9%
fma-def99.9%
*-commutative99.9%
associate-/l*99.4%
associate-/l*99.6%
Simplified99.6%
fma-udef99.6%
associate-/l*100.0%
+-commutative100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 72.2%
*-commutative72.2%
*-commutative72.2%
associate-*r*72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in z around inf 63.5%
associate-*r*63.5%
*-commutative63.5%
Simplified63.5%
Final simplification55.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ (* x y) (* (* z t) 0.0625))))
(if (<= (* x y) -4.3e+77)
t_2
(if (<= (* x y) 1.3e-46)
t_1
(if (<= (* x y) 1.06)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 3.35e+66) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((x * y) <= -4.3e+77) {
tmp = t_2;
} else if ((x * y) <= 1.3e-46) {
tmp = t_1;
} else if ((x * y) <= 1.06) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 3.35e+66) {
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 + (a * (b * (-0.25d0)))
t_2 = (x * y) + ((z * t) * 0.0625d0)
if ((x * y) <= (-4.3d+77)) then
tmp = t_2
else if ((x * y) <= 1.3d-46) then
tmp = t_1
else if ((x * y) <= 1.06d0) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 3.35d+66) 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 + (a * (b * -0.25));
double t_2 = (x * y) + ((z * t) * 0.0625);
double tmp;
if ((x * y) <= -4.3e+77) {
tmp = t_2;
} else if ((x * y) <= 1.3e-46) {
tmp = t_1;
} else if ((x * y) <= 1.06) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 3.35e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = (x * y) + ((z * t) * 0.0625) tmp = 0 if (x * y) <= -4.3e+77: tmp = t_2 elif (x * y) <= 1.3e-46: tmp = t_1 elif (x * y) <= 1.06: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 3.35e+66: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -4.3e+77) tmp = t_2; elseif (Float64(x * y) <= 1.3e-46) tmp = t_1; elseif (Float64(x * y) <= 1.06) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 3.35e+66) 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 + (a * (b * -0.25)); t_2 = (x * y) + ((z * t) * 0.0625); tmp = 0.0; if ((x * y) <= -4.3e+77) tmp = t_2; elseif ((x * y) <= 1.3e-46) tmp = t_1; elseif ((x * y) <= 1.06) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 3.35e+66) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.3e+77], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.3e-46], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.06], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.35e+66], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;x \cdot y \leq -4.3 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.06:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 3.35 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.29999999999999991e77 or 3.34999999999999984e66 < (*.f64 x y) Initial program 92.7%
Taylor expanded in a around 0 88.1%
+-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
*-commutative88.1%
+-commutative88.1%
associate-+l+88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
fma-def88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in c around 0 77.9%
if -4.29999999999999991e77 < (*.f64 x y) < 1.3000000000000001e-46 or 1.0600000000000001 < (*.f64 x y) < 3.34999999999999984e66Initial program 99.2%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
associate-*r*73.6%
Simplified73.6%
if 1.3000000000000001e-46 < (*.f64 x y) < 1.0600000000000001Initial program 99.9%
Taylor expanded in z around inf 72.2%
associate-*r*72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Final simplification75.4%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (+ c (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in a around inf 78.4%
*-commutative78.4%
associate-*r*78.4%
Simplified78.4%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -1.45e+80)
t_2
(if (<= (* x y) 3.15e-43)
t_1
(if (<= (* x y) 800.0)
(+ c (* t (* z 0.0625)))
(if (<= (* x y) 6e+72) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.45e+80) {
tmp = t_2;
} else if ((x * y) <= 3.15e-43) {
tmp = t_1;
} else if ((x * y) <= 800.0) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 6e+72) {
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 + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-1.45d+80)) then
tmp = t_2
else if ((x * y) <= 3.15d-43) then
tmp = t_1
else if ((x * y) <= 800.0d0) then
tmp = c + (t * (z * 0.0625d0))
else if ((x * y) <= 6d+72) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -1.45e+80) {
tmp = t_2;
} else if ((x * y) <= 3.15e-43) {
tmp = t_1;
} else if ((x * y) <= 800.0) {
tmp = c + (t * (z * 0.0625));
} else if ((x * y) <= 6e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -1.45e+80: tmp = t_2 elif (x * y) <= 3.15e-43: tmp = t_1 elif (x * y) <= 800.0: tmp = c + (t * (z * 0.0625)) elif (x * y) <= 6e+72: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.45e+80) tmp = t_2; elseif (Float64(x * y) <= 3.15e-43) tmp = t_1; elseif (Float64(x * y) <= 800.0) tmp = Float64(c + Float64(t * Float64(z * 0.0625))); elseif (Float64(x * y) <= 6e+72) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.45e+80) tmp = t_2; elseif ((x * y) <= 3.15e-43) tmp = t_1; elseif ((x * y) <= 800.0) tmp = c + (t * (z * 0.0625)); elseif ((x * y) <= 6e+72) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.45e+80], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.15e-43], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 800.0], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6e+72], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.45 \cdot 10^{+80}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 3.15 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 800:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.44999999999999993e80 or 6.00000000000000006e72 < (*.f64 x y) Initial program 92.5%
Taylor expanded in x around inf 76.9%
if -1.44999999999999993e80 < (*.f64 x y) < 3.1500000000000001e-43 or 800 < (*.f64 x y) < 6.00000000000000006e72Initial program 99.3%
Taylor expanded in a around inf 72.0%
*-commutative72.0%
associate-*r*72.0%
Simplified72.0%
if 3.1500000000000001e-43 < (*.f64 x y) < 800Initial program 99.9%
Taylor expanded in z around inf 72.2%
associate-*r*72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Final simplification74.1%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -3.3e+122)
(* x y)
(if (<= (* x y) 1.05e-196)
c
(if (<= (* x y) 7.3e+59) (* b (* a -0.25)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -3.3e+122) {
tmp = x * y;
} else if ((x * y) <= 1.05e-196) {
tmp = c;
} else if ((x * y) <= 7.3e+59) {
tmp = b * (a * -0.25);
} else {
tmp = 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 ((x * y) <= (-3.3d+122)) then
tmp = x * y
else if ((x * y) <= 1.05d-196) then
tmp = c
else if ((x * y) <= 7.3d+59) then
tmp = b * (a * (-0.25d0))
else
tmp = 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 ((x * y) <= -3.3e+122) {
tmp = x * y;
} else if ((x * y) <= 1.05e-196) {
tmp = c;
} else if ((x * y) <= 7.3e+59) {
tmp = b * (a * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -3.3e+122: tmp = x * y elif (x * y) <= 1.05e-196: tmp = c elif (x * y) <= 7.3e+59: tmp = b * (a * -0.25) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -3.3e+122) tmp = Float64(x * y); elseif (Float64(x * y) <= 1.05e-196) tmp = c; elseif (Float64(x * y) <= 7.3e+59) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -3.3e+122) tmp = x * y; elseif ((x * y) <= 1.05e-196) tmp = c; elseif ((x * y) <= 7.3e+59) tmp = b * (a * -0.25); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -3.3e+122], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.05e-196], c, If[LessEqual[N[(x * y), $MachinePrecision], 7.3e+59], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.3 \cdot 10^{+122}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{-196}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 7.3 \cdot 10^{+59}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.2999999999999999e122 or 7.3000000000000003e59 < (*.f64 x y) Initial program 91.7%
Taylor expanded in z around 0 82.5%
Taylor expanded in c around 0 75.9%
Taylor expanded in x around inf 68.9%
if -3.2999999999999999e122 < (*.f64 x y) < 1.04999999999999994e-196Initial program 99.1%
Taylor expanded in c around inf 41.9%
if 1.04999999999999994e-196 < (*.f64 x y) < 7.3000000000000003e59Initial program 100.0%
Taylor expanded in z around 0 69.3%
Taylor expanded in c around 0 50.9%
Taylor expanded in x around 0 48.9%
associate-*r*48.9%
*-commutative48.9%
Simplified48.9%
Final simplification53.4%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+209)
(* b (* a -0.25))
(if (<= (* a b) 1e+114)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(- (* 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) <= -2e+209) {
tmp = b * (a * -0.25);
} else if ((a * b) <= 1e+114) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} 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) <= (-2d+209)) then
tmp = b * (a * (-0.25d0))
else if ((a * b) <= 1d+114) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
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) <= -2e+209) {
tmp = b * (a * -0.25);
} else if ((a * b) <= 1e+114) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+209: tmp = b * (a * -0.25) elif (a * b) <= 1e+114: tmp = c + ((x * y) + ((z * t) * 0.0625)) 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) <= -2e+209) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(a * b) <= 1e+114) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); 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) <= -2e+209) tmp = b * (a * -0.25); elseif ((a * b) <= 1e+114) tmp = c + ((x * y) + ((z * t) * 0.0625)); 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], -2e+209], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+114], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $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 \cdot 10^{+209}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+114}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e209Initial program 87.5%
Taylor expanded in z around 0 93.8%
Taylor expanded in c around 0 93.8%
Taylor expanded in x around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if -2.0000000000000001e209 < (*.f64 a b) < 1e114Initial program 98.9%
Taylor expanded in a around 0 93.2%
if 1e114 < (*.f64 a b) Initial program 91.4%
Taylor expanded in z around 0 86.5%
Taylor expanded in c around 0 81.8%
Final simplification92.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+209)
(* b (* a -0.25))
(if (<= (* a b) 1e+99)
(+ c (+ (* x y) (* (* z t) 0.0625)))
(- (+ c (* 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) <= -2e+209) {
tmp = b * (a * -0.25);
} else if ((a * b) <= 1e+99) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = (c + (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) <= (-2d+209)) then
tmp = b * (a * (-0.25d0))
else if ((a * b) <= 1d+99) then
tmp = c + ((x * y) + ((z * t) * 0.0625d0))
else
tmp = (c + (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) <= -2e+209) {
tmp = b * (a * -0.25);
} else if ((a * b) <= 1e+99) {
tmp = c + ((x * y) + ((z * t) * 0.0625));
} else {
tmp = (c + (x * y)) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+209: tmp = b * (a * -0.25) elif (a * b) <= 1e+99: tmp = c + ((x * y) + ((z * t) * 0.0625)) else: tmp = (c + (x * y)) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+209) tmp = Float64(b * Float64(a * -0.25)); elseif (Float64(a * b) <= 1e+99) tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))); else tmp = Float64(Float64(c + 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) <= -2e+209) tmp = b * (a * -0.25); elseif ((a * b) <= 1e+99) tmp = c + ((x * y) + ((z * t) * 0.0625)); else tmp = (c + (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], -2e+209], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+99], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+209}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+99}:\\
\;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0000000000000001e209Initial program 87.5%
Taylor expanded in z around 0 93.8%
Taylor expanded in c around 0 93.8%
Taylor expanded in x around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if -2.0000000000000001e209 < (*.f64 a b) < 9.9999999999999997e98Initial program 98.9%
Taylor expanded in a around 0 93.2%
if 9.9999999999999997e98 < (*.f64 a b) Initial program 91.6%
Taylor expanded in z around 0 86.9%
Final simplification93.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* z t) 0.0625)) (t_2 (* (* a b) 0.25)))
(if (<= (* a b) -1e+121)
(- (+ c t_1) t_2)
(if (<= (* a b) 1e+99) (+ c (+ (* x y) t_1)) (- (+ c (* x y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -1e+121) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 1e+99) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - 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 = (z * t) * 0.0625d0
t_2 = (a * b) * 0.25d0
if ((a * b) <= (-1d+121)) then
tmp = (c + t_1) - t_2
else if ((a * b) <= 1d+99) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + (x * y)) - 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 = (z * t) * 0.0625;
double t_2 = (a * b) * 0.25;
double tmp;
if ((a * b) <= -1e+121) {
tmp = (c + t_1) - t_2;
} else if ((a * b) <= 1e+99) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (z * t) * 0.0625 t_2 = (a * b) * 0.25 tmp = 0 if (a * b) <= -1e+121: tmp = (c + t_1) - t_2 elif (a * b) <= 1e+99: tmp = c + ((x * y) + t_1) else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(z * t) * 0.0625) t_2 = Float64(Float64(a * b) * 0.25) tmp = 0.0 if (Float64(a * b) <= -1e+121) tmp = Float64(Float64(c + t_1) - t_2); elseif (Float64(a * b) <= 1e+99) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + Float64(x * y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (z * t) * 0.0625; t_2 = (a * b) * 0.25; tmp = 0.0; if ((a * b) <= -1e+121) tmp = (c + t_1) - t_2; elseif ((a * b) <= 1e+99) tmp = c + ((x * y) + t_1); else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+121], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+99], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
t_2 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+121}:\\
\;\;\;\;\left(c + t\_1\right) - t\_2\\
\mathbf{elif}\;a \cdot b \leq 10^{+99}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e121Initial program 92.0%
Taylor expanded in x around 0 92.1%
if -1.00000000000000004e121 < (*.f64 a b) < 9.9999999999999997e98Initial program 98.8%
Taylor expanded in a around 0 95.8%
if 9.9999999999999997e98 < (*.f64 a b) Initial program 91.6%
Taylor expanded in z around 0 86.9%
Final simplification93.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.35e+80) (not (<= (* x y) 2.6e+71))) (+ c (* x y)) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.35e+80) || !((x * y) <= 2.6e+71)) {
tmp = c + (x * y);
} else {
tmp = c + (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 (((x * y) <= (-1.35d+80)) .or. (.not. ((x * y) <= 2.6d+71))) then
tmp = c + (x * y)
else
tmp = c + (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 (((x * y) <= -1.35e+80) || !((x * y) <= 2.6e+71)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.35e+80) or not ((x * y) <= 2.6e+71): tmp = c + (x * y) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.35e+80) || !(Float64(x * y) <= 2.6e+71)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.35e+80) || ~(((x * y) <= 2.6e+71))) tmp = c + (x * y); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.35e+80], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.6e+71]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+80} \lor \neg \left(x \cdot y \leq 2.6 \cdot 10^{+71}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.34999999999999991e80 or 2.59999999999999991e71 < (*.f64 x y) Initial program 92.5%
Taylor expanded in x around inf 76.9%
if -1.34999999999999991e80 < (*.f64 x y) < 2.59999999999999991e71Initial program 99.3%
Taylor expanded in a around inf 69.1%
*-commutative69.1%
associate-*r*69.1%
Simplified69.1%
Final simplification72.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.8e+122) (not (<= (* x y) 2.9e+67))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.8e+122) || !((x * y) <= 2.9e+67)) {
tmp = x * y;
} 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 (((x * y) <= (-1.8d+122)) .or. (.not. ((x * y) <= 2.9d+67))) then
tmp = x * y
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 (((x * y) <= -1.8e+122) || !((x * y) <= 2.9e+67)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.8e+122) or not ((x * y) <= 2.9e+67): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.8e+122) || !(Float64(x * y) <= 2.9e+67)) tmp = Float64(x * y); else tmp = c; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -1.8e+122) || ~(((x * y) <= 2.9e+67))) tmp = x * y; else tmp = c; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.8e+122], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.9e+67]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+122} \lor \neg \left(x \cdot y \leq 2.9 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8000000000000001e122 or 2.90000000000000023e67 < (*.f64 x y) Initial program 91.5%
Taylor expanded in z around 0 83.2%
Taylor expanded in c around 0 77.5%
Taylor expanded in x around inf 70.3%
if -1.8000000000000001e122 < (*.f64 x y) < 2.90000000000000023e67Initial program 99.3%
Taylor expanded in c around inf 35.8%
Final simplification48.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -1.2e+105) (not (<= a 2.4e-75))) (* b (* a -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -1.2e+105) || !(a <= 2.4e-75)) {
tmp = b * (a * -0.25);
} 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 ((a <= (-1.2d+105)) .or. (.not. (a <= 2.4d-75))) then
tmp = b * (a * (-0.25d0))
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 ((a <= -1.2e+105) || !(a <= 2.4e-75)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -1.2e+105) or not (a <= 2.4e-75): tmp = b * (a * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -1.2e+105) || !(a <= 2.4e-75)) tmp = Float64(b * Float64(a * -0.25)); 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 ((a <= -1.2e+105) || ~((a <= 2.4e-75))) tmp = b * (a * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.2e+105], N[Not[LessEqual[a, 2.4e-75]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+105} \lor \neg \left(a \leq 2.4 \cdot 10^{-75}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.19999999999999987e105 or 2.40000000000000019e-75 < a Initial program 93.9%
Taylor expanded in z around 0 75.6%
Taylor expanded in c around 0 60.6%
Taylor expanded in x around 0 48.6%
associate-*r*48.6%
*-commutative48.6%
Simplified48.6%
if -1.19999999999999987e105 < a < 2.40000000000000019e-75Initial program 98.5%
Taylor expanded in x around inf 70.2%
Final simplification60.5%
(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 96.4%
Taylor expanded in c around inf 25.2%
Final simplification25.2%
herbie shell --seed 2024027
(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))