
(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 (/ 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 fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 98.4%
associate--l+98.4%
fma-define98.8%
associate-/l*98.8%
fma-neg99.6%
distribute-neg-frac299.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma 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 + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 98.4%
associate-+l-98.4%
*-commutative98.4%
associate-+l-98.4%
fma-define98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25))))
(t_2 (+ c (* z (* t 0.0625))))
(t_3 (* y (+ x (* (* b -0.25) (/ a y))))))
(if (<= (* x y) -2e+189)
t_3
(if (<= (* x y) -2e+122)
t_2
(if (<= (* x y) -5e+90)
t_3
(if (<= (* x y) -5e-135)
t_1
(if (<= (* x y) 0.0)
t_2
(if (<= (* x y) 1e-180)
t_1
(if (<= (* x y) 5e-69)
t_2
(if (<= (* x y) 1e-14)
t_1
(if (<= (* x y) 5e+102) t_2 t_3)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = c + (z * (t * 0.0625));
double t_3 = y * (x + ((b * -0.25) * (a / y)));
double tmp;
if ((x * y) <= -2e+189) {
tmp = t_3;
} else if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -5e+90) {
tmp = t_3;
} else if ((x * y) <= -5e-135) {
tmp = t_1;
} else if ((x * y) <= 0.0) {
tmp = t_2;
} else if ((x * y) <= 1e-180) {
tmp = t_1;
} else if ((x * y) <= 5e-69) {
tmp = t_2;
} else if ((x * y) <= 1e-14) {
tmp = t_1;
} else if ((x * y) <= 5e+102) {
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 + (b * (a * (-0.25d0)))
t_2 = c + (z * (t * 0.0625d0))
t_3 = y * (x + ((b * (-0.25d0)) * (a / y)))
if ((x * y) <= (-2d+189)) then
tmp = t_3
else if ((x * y) <= (-2d+122)) then
tmp = t_2
else if ((x * y) <= (-5d+90)) then
tmp = t_3
else if ((x * y) <= (-5d-135)) then
tmp = t_1
else if ((x * y) <= 0.0d0) then
tmp = t_2
else if ((x * y) <= 1d-180) then
tmp = t_1
else if ((x * y) <= 5d-69) then
tmp = t_2
else if ((x * y) <= 1d-14) then
tmp = t_1
else if ((x * y) <= 5d+102) 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 + (b * (a * -0.25));
double t_2 = c + (z * (t * 0.0625));
double t_3 = y * (x + ((b * -0.25) * (a / y)));
double tmp;
if ((x * y) <= -2e+189) {
tmp = t_3;
} else if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -5e+90) {
tmp = t_3;
} else if ((x * y) <= -5e-135) {
tmp = t_1;
} else if ((x * y) <= 0.0) {
tmp = t_2;
} else if ((x * y) <= 1e-180) {
tmp = t_1;
} else if ((x * y) <= 5e-69) {
tmp = t_2;
} else if ((x * y) <= 1e-14) {
tmp = t_1;
} else if ((x * y) <= 5e+102) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) t_2 = c + (z * (t * 0.0625)) t_3 = y * (x + ((b * -0.25) * (a / y))) tmp = 0 if (x * y) <= -2e+189: tmp = t_3 elif (x * y) <= -2e+122: tmp = t_2 elif (x * y) <= -5e+90: tmp = t_3 elif (x * y) <= -5e-135: tmp = t_1 elif (x * y) <= 0.0: tmp = t_2 elif (x * y) <= 1e-180: tmp = t_1 elif (x * y) <= 5e-69: tmp = t_2 elif (x * y) <= 1e-14: tmp = t_1 elif (x * y) <= 5e+102: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) t_2 = Float64(c + Float64(z * Float64(t * 0.0625))) t_3 = Float64(y * Float64(x + Float64(Float64(b * -0.25) * Float64(a / y)))) tmp = 0.0 if (Float64(x * y) <= -2e+189) tmp = t_3; elseif (Float64(x * y) <= -2e+122) tmp = t_2; elseif (Float64(x * y) <= -5e+90) tmp = t_3; elseif (Float64(x * y) <= -5e-135) tmp = t_1; elseif (Float64(x * y) <= 0.0) tmp = t_2; elseif (Float64(x * y) <= 1e-180) tmp = t_1; elseif (Float64(x * y) <= 5e-69) tmp = t_2; elseif (Float64(x * y) <= 1e-14) tmp = t_1; elseif (Float64(x * y) <= 5e+102) 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 + (b * (a * -0.25)); t_2 = c + (z * (t * 0.0625)); t_3 = y * (x + ((b * -0.25) * (a / y))); tmp = 0.0; if ((x * y) <= -2e+189) tmp = t_3; elseif ((x * y) <= -2e+122) tmp = t_2; elseif ((x * y) <= -5e+90) tmp = t_3; elseif ((x * y) <= -5e-135) tmp = t_1; elseif ((x * y) <= 0.0) tmp = t_2; elseif ((x * y) <= 1e-180) tmp = t_1; elseif ((x * y) <= 5e-69) tmp = t_2; elseif ((x * y) <= 1e-14) tmp = t_1; elseif ((x * y) <= 5e+102) 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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(x + N[(N[(b * -0.25), $MachinePrecision] * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+189], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2e+122], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e+90], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5e-135], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-180], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-69], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e-14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+102], t$95$2, t$95$3]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_3 := y \cdot \left(x + \left(b \cdot -0.25\right) \cdot \frac{a}{y}\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+189}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+90}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2e189 or -2.00000000000000003e122 < (*.f64 x y) < -5.0000000000000004e90 or 5e102 < (*.f64 x y) Initial program 96.5%
Taylor expanded in z around 0 89.4%
Taylor expanded in y around inf 91.7%
associate--l+91.7%
associate-*r/91.7%
div-sub91.7%
*-commutative91.7%
associate-*r*91.7%
sub-neg91.7%
distribute-rgt-neg-in91.7%
distribute-rgt-neg-in91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in c around 0 88.1%
associate-*r/88.1%
*-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-/l*87.0%
*-commutative87.0%
Simplified87.0%
if -2e189 < (*.f64 x y) < -2.00000000000000003e122 or -5.0000000000000002e-135 < (*.f64 x y) < 0.0 or 1e-180 < (*.f64 x y) < 5.00000000000000033e-69 or 9.99999999999999999e-15 < (*.f64 x y) < 5e102Initial program 99.9%
Taylor expanded in z around inf 75.4%
associate-*r*75.4%
*-commutative75.4%
*-commutative75.4%
*-commutative75.4%
Simplified75.4%
if -5.0000000000000004e90 < (*.f64 x y) < -5.0000000000000002e-135 or 0.0 < (*.f64 x y) < 1e-180 or 5.00000000000000033e-69 < (*.f64 x y) < 9.99999999999999999e-15Initial program 98.6%
Taylor expanded in a around inf 75.7%
*-commutative75.7%
*-commutative75.7%
associate-*r*75.7%
Simplified75.7%
Final simplification79.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -3.1e+197)
(* x y)
(if (<= (* x y) -9e-209)
t_1
(if (<= (* x y) 1.55e-190)
c
(if (<= (* x y) 1.25e-53)
t_1
(if (<= (* x y) 7.5e+105) c (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * (b * -0.25);
double tmp;
if ((x * y) <= -3.1e+197) {
tmp = x * y;
} else if ((x * y) <= -9e-209) {
tmp = t_1;
} else if ((x * y) <= 1.55e-190) {
tmp = c;
} else if ((x * y) <= 1.25e-53) {
tmp = t_1;
} else if ((x * y) <= 7.5e+105) {
tmp = c;
} 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 = a * (b * (-0.25d0))
if ((x * y) <= (-3.1d+197)) then
tmp = x * y
else if ((x * y) <= (-9d-209)) then
tmp = t_1
else if ((x * y) <= 1.55d-190) then
tmp = c
else if ((x * y) <= 1.25d-53) then
tmp = t_1
else if ((x * y) <= 7.5d+105) then
tmp = c
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 = a * (b * -0.25);
double tmp;
if ((x * y) <= -3.1e+197) {
tmp = x * y;
} else if ((x * y) <= -9e-209) {
tmp = t_1;
} else if ((x * y) <= 1.55e-190) {
tmp = c;
} else if ((x * y) <= 1.25e-53) {
tmp = t_1;
} else if ((x * y) <= 7.5e+105) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if (x * y) <= -3.1e+197: tmp = x * y elif (x * y) <= -9e-209: tmp = t_1 elif (x * y) <= 1.55e-190: tmp = c elif (x * y) <= 1.25e-53: tmp = t_1 elif (x * y) <= 7.5e+105: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(x * y) <= -3.1e+197) tmp = Float64(x * y); elseif (Float64(x * y) <= -9e-209) tmp = t_1; elseif (Float64(x * y) <= 1.55e-190) tmp = c; elseif (Float64(x * y) <= 1.25e-53) tmp = t_1; elseif (Float64(x * y) <= 7.5e+105) tmp = c; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); tmp = 0.0; if ((x * y) <= -3.1e+197) tmp = x * y; elseif ((x * y) <= -9e-209) tmp = t_1; elseif ((x * y) <= 1.55e-190) tmp = c; elseif ((x * y) <= 1.25e-53) tmp = t_1; elseif ((x * y) <= 7.5e+105) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.1e+197], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -9e-209], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-190], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.25e-53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7.5e+105], c, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -3.1 \cdot 10^{+197}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-190}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+105}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.1e197 or 7.5000000000000002e105 < (*.f64 x y) Initial program 96.1%
Taylor expanded in x around inf 75.2%
Taylor expanded in c around inf 65.5%
Taylor expanded in c around 0 71.9%
if -3.1e197 < (*.f64 x y) < -8.9999999999999996e-209 or 1.54999999999999997e-190 < (*.f64 x y) < 1.25e-53Initial program 99.0%
Taylor expanded in z around 0 59.4%
Taylor expanded in y around inf 49.8%
associate--l+49.8%
associate-*r/49.8%
div-sub51.9%
*-commutative51.9%
associate-*r*51.9%
sub-neg51.9%
distribute-rgt-neg-in51.9%
distribute-rgt-neg-in51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in a around inf 35.1%
*-commutative35.1%
associate-*r*35.1%
*-commutative35.1%
Simplified35.1%
if -8.9999999999999996e-209 < (*.f64 x y) < 1.54999999999999997e-190 or 1.25e-53 < (*.f64 x y) < 7.5000000000000002e105Initial program 100.0%
Taylor expanded in c around inf 43.8%
Final simplification49.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625)))
(t_2 (+ c (* b (* a -0.25))))
(t_3 (+ c (* x y))))
(if (<= a -8e+142)
t_2
(if (<= a -9.2e+111)
t_1
(if (<= a -2.6e+84)
t_2
(if (<= a -1.35e-235)
t_3
(if (<= a -2.3e-292) t_1 (if (<= a 6e-33) t_3 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 = c + (b * (a * -0.25));
double t_3 = c + (x * y);
double tmp;
if (a <= -8e+142) {
tmp = t_2;
} else if (a <= -9.2e+111) {
tmp = t_1;
} else if (a <= -2.6e+84) {
tmp = t_2;
} else if (a <= -1.35e-235) {
tmp = t_3;
} else if (a <= -2.3e-292) {
tmp = t_1;
} else if (a <= 6e-33) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = z * (t * 0.0625d0)
t_2 = c + (b * (a * (-0.25d0)))
t_3 = c + (x * y)
if (a <= (-8d+142)) then
tmp = t_2
else if (a <= (-9.2d+111)) then
tmp = t_1
else if (a <= (-2.6d+84)) then
tmp = t_2
else if (a <= (-1.35d-235)) then
tmp = t_3
else if (a <= (-2.3d-292)) then
tmp = t_1
else if (a <= 6d-33) then
tmp = t_3
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 = z * (t * 0.0625);
double t_2 = c + (b * (a * -0.25));
double t_3 = c + (x * y);
double tmp;
if (a <= -8e+142) {
tmp = t_2;
} else if (a <= -9.2e+111) {
tmp = t_1;
} else if (a <= -2.6e+84) {
tmp = t_2;
} else if (a <= -1.35e-235) {
tmp = t_3;
} else if (a <= -2.3e-292) {
tmp = t_1;
} else if (a <= 6e-33) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) t_2 = c + (b * (a * -0.25)) t_3 = c + (x * y) tmp = 0 if a <= -8e+142: tmp = t_2 elif a <= -9.2e+111: tmp = t_1 elif a <= -2.6e+84: tmp = t_2 elif a <= -1.35e-235: tmp = t_3 elif a <= -2.3e-292: tmp = t_1 elif a <= 6e-33: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) t_2 = Float64(c + Float64(b * Float64(a * -0.25))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (a <= -8e+142) tmp = t_2; elseif (a <= -9.2e+111) tmp = t_1; elseif (a <= -2.6e+84) tmp = t_2; elseif (a <= -1.35e-235) tmp = t_3; elseif (a <= -2.3e-292) tmp = t_1; elseif (a <= 6e-33) tmp = t_3; else tmp = 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 = c + (b * (a * -0.25)); t_3 = c + (x * y); tmp = 0.0; if (a <= -8e+142) tmp = t_2; elseif (a <= -9.2e+111) tmp = t_1; elseif (a <= -2.6e+84) tmp = t_2; elseif (a <= -1.35e-235) tmp = t_3; elseif (a <= -2.3e-292) tmp = t_1; elseif (a <= 6e-33) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e+142], t$95$2, If[LessEqual[a, -9.2e+111], t$95$1, If[LessEqual[a, -2.6e+84], t$95$2, If[LessEqual[a, -1.35e-235], t$95$3, If[LessEqual[a, -2.3e-292], t$95$1, If[LessEqual[a, 6e-33], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + b \cdot \left(a \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;a \leq -8 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -9.2 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.35 \cdot 10^{-235}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-292}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-33}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -8.00000000000000041e142 or -9.20000000000000008e111 < a < -2.6000000000000001e84 or 6.0000000000000003e-33 < a Initial program 97.1%
Taylor expanded in a around inf 71.4%
*-commutative71.4%
*-commutative71.4%
associate-*r*71.4%
Simplified71.4%
if -8.00000000000000041e142 < a < -9.20000000000000008e111 or -1.3500000000000001e-235 < a < -2.2999999999999999e-292Initial program 100.0%
Taylor expanded in z around inf 70.5%
associate-*r*70.5%
*-commutative70.5%
*-commutative70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around inf 70.5%
Taylor expanded in t around inf 64.8%
if -2.6000000000000001e84 < a < -1.3500000000000001e-235 or -2.2999999999999999e-292 < a < 6.0000000000000003e-33Initial program 99.2%
Taylor expanded in x around inf 56.1%
Final simplification62.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))) (t_2 (* a (* b -0.25))))
(if (<= b -6.8e-60)
t_2
(if (<= b -2.5e-141)
t_1
(if (<= b -2.05e-271)
c
(if (<= b 1.5e-49)
t_1
(if (<= b 3.7e+42) c (if (<= b 4.5e+95) (* 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 (b <= -6.8e-60) {
tmp = t_2;
} else if (b <= -2.5e-141) {
tmp = t_1;
} else if (b <= -2.05e-271) {
tmp = c;
} else if (b <= 1.5e-49) {
tmp = t_1;
} else if (b <= 3.7e+42) {
tmp = c;
} else if (b <= 4.5e+95) {
tmp = x * y;
} 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 = z * (t * 0.0625d0)
t_2 = a * (b * (-0.25d0))
if (b <= (-6.8d-60)) then
tmp = t_2
else if (b <= (-2.5d-141)) then
tmp = t_1
else if (b <= (-2.05d-271)) then
tmp = c
else if (b <= 1.5d-49) then
tmp = t_1
else if (b <= 3.7d+42) then
tmp = c
else if (b <= 4.5d+95) then
tmp = x * y
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 = z * (t * 0.0625);
double t_2 = a * (b * -0.25);
double tmp;
if (b <= -6.8e-60) {
tmp = t_2;
} else if (b <= -2.5e-141) {
tmp = t_1;
} else if (b <= -2.05e-271) {
tmp = c;
} else if (b <= 1.5e-49) {
tmp = t_1;
} else if (b <= 3.7e+42) {
tmp = c;
} else if (b <= 4.5e+95) {
tmp = x * y;
} else {
tmp = 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 b <= -6.8e-60: tmp = t_2 elif b <= -2.5e-141: tmp = t_1 elif b <= -2.05e-271: tmp = c elif b <= 1.5e-49: tmp = t_1 elif b <= 3.7e+42: tmp = c elif b <= 4.5e+95: tmp = x * y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) t_2 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (b <= -6.8e-60) tmp = t_2; elseif (b <= -2.5e-141) tmp = t_1; elseif (b <= -2.05e-271) tmp = c; elseif (b <= 1.5e-49) tmp = t_1; elseif (b <= 3.7e+42) tmp = c; elseif (b <= 4.5e+95) tmp = Float64(x * y); else tmp = 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 (b <= -6.8e-60) tmp = t_2; elseif (b <= -2.5e-141) tmp = t_1; elseif (b <= -2.05e-271) tmp = c; elseif (b <= 1.5e-49) tmp = t_1; elseif (b <= 3.7e+42) tmp = c; elseif (b <= 4.5e+95) tmp = x * y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.8e-60], t$95$2, If[LessEqual[b, -2.5e-141], t$95$1, If[LessEqual[b, -2.05e-271], c, If[LessEqual[b, 1.5e-49], t$95$1, If[LessEqual[b, 3.7e+42], c, If[LessEqual[b, 4.5e+95], N[(x * y), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
t_2 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;b \leq -6.8 \cdot 10^{-60}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -2.5 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.05 \cdot 10^{-271}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{+42}:\\
\;\;\;\;c\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+95}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -6.80000000000000013e-60 or 4.50000000000000017e95 < b Initial program 96.9%
Taylor expanded in z around 0 73.6%
Taylor expanded in y around inf 65.4%
associate--l+65.4%
associate-*r/65.4%
div-sub68.5%
*-commutative68.5%
associate-*r*68.5%
sub-neg68.5%
distribute-rgt-neg-in68.5%
distribute-rgt-neg-in68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in a around inf 45.5%
*-commutative45.5%
associate-*r*45.5%
*-commutative45.5%
Simplified45.5%
if -6.80000000000000013e-60 < b < -2.5e-141 or -2.0500000000000001e-271 < b < 1.5e-49Initial program 99.9%
Taylor expanded in z around inf 65.2%
associate-*r*65.2%
*-commutative65.2%
*-commutative65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 58.5%
Taylor expanded in t around inf 38.9%
if -2.5e-141 < b < -2.0500000000000001e-271 or 1.5e-49 < b < 3.69999999999999996e42Initial program 100.0%
Taylor expanded in c around inf 33.6%
if 3.69999999999999996e42 < b < 4.50000000000000017e95Initial program 99.9%
Taylor expanded in x around inf 66.5%
Taylor expanded in c around inf 50.9%
Taylor expanded in c around 0 58.5%
Final simplification42.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* z (* t 0.0625))))
(t_2 (+ c (* b (* a -0.25))))
(t_3 (+ c (* x y))))
(if (<= b -5.9e-46)
t_2
(if (<= b -5.3e-169)
t_1
(if (<= b -2.8e-270)
t_3
(if (<= b 1.8e-50) t_1 (if (<= b 2.3e+95) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (z * (t * 0.0625));
double t_2 = c + (b * (a * -0.25));
double t_3 = c + (x * y);
double tmp;
if (b <= -5.9e-46) {
tmp = t_2;
} else if (b <= -5.3e-169) {
tmp = t_1;
} else if (b <= -2.8e-270) {
tmp = t_3;
} else if (b <= 1.8e-50) {
tmp = t_1;
} else if (b <= 2.3e+95) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = c + (z * (t * 0.0625d0))
t_2 = c + (b * (a * (-0.25d0)))
t_3 = c + (x * y)
if (b <= (-5.9d-46)) then
tmp = t_2
else if (b <= (-5.3d-169)) then
tmp = t_1
else if (b <= (-2.8d-270)) then
tmp = t_3
else if (b <= 1.8d-50) then
tmp = t_1
else if (b <= 2.3d+95) then
tmp = t_3
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 + (z * (t * 0.0625));
double t_2 = c + (b * (a * -0.25));
double t_3 = c + (x * y);
double tmp;
if (b <= -5.9e-46) {
tmp = t_2;
} else if (b <= -5.3e-169) {
tmp = t_1;
} else if (b <= -2.8e-270) {
tmp = t_3;
} else if (b <= 1.8e-50) {
tmp = t_1;
} else if (b <= 2.3e+95) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (z * (t * 0.0625)) t_2 = c + (b * (a * -0.25)) t_3 = c + (x * y) tmp = 0 if b <= -5.9e-46: tmp = t_2 elif b <= -5.3e-169: tmp = t_1 elif b <= -2.8e-270: tmp = t_3 elif b <= 1.8e-50: tmp = t_1 elif b <= 2.3e+95: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(z * Float64(t * 0.0625))) t_2 = Float64(c + Float64(b * Float64(a * -0.25))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (b <= -5.9e-46) tmp = t_2; elseif (b <= -5.3e-169) tmp = t_1; elseif (b <= -2.8e-270) tmp = t_3; elseif (b <= 1.8e-50) tmp = t_1; elseif (b <= 2.3e+95) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (z * (t * 0.0625)); t_2 = c + (b * (a * -0.25)); t_3 = c + (x * y); tmp = 0.0; if (b <= -5.9e-46) tmp = t_2; elseif (b <= -5.3e-169) tmp = t_1; elseif (b <= -2.8e-270) tmp = t_3; elseif (b <= 1.8e-50) tmp = t_1; elseif (b <= 2.3e+95) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.9e-46], t$95$2, If[LessEqual[b, -5.3e-169], t$95$1, If[LessEqual[b, -2.8e-270], t$95$3, If[LessEqual[b, 1.8e-50], t$95$1, If[LessEqual[b, 2.3e+95], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_2 := c + b \cdot \left(a \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;b \leq -5.9 \cdot 10^{-46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -5.3 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.8 \cdot 10^{-270}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+95}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -5.8999999999999999e-46 or 2.29999999999999997e95 < b Initial program 96.7%
Taylor expanded in a around inf 59.4%
*-commutative59.4%
*-commutative59.4%
associate-*r*59.4%
Simplified59.4%
if -5.8999999999999999e-46 < b < -5.3e-169 or -2.7999999999999999e-270 < b < 1.7999999999999999e-50Initial program 99.9%
Taylor expanded in z around inf 62.3%
associate-*r*62.3%
*-commutative62.3%
*-commutative62.3%
*-commutative62.3%
Simplified62.3%
if -5.3e-169 < b < -2.7999999999999999e-270 or 1.7999999999999999e-50 < b < 2.29999999999999997e95Initial program 100.0%
Taylor expanded in x around inf 66.9%
Final simplification61.8%
(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) -5e+40)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 2e+110) (+ c (+ (* x y) t_2)) (- (+ c t_2) 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) <= -5e+40) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 2e+110) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - 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) <= (-5d+40)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 2d+110) then
tmp = c + ((x * y) + t_2)
else
tmp = (c + t_2) - 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) <= -5e+40) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 2e+110) {
tmp = c + ((x * y) + t_2);
} else {
tmp = (c + t_2) - 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) <= -5e+40: tmp = (c + (x * y)) - t_1 elif (a * b) <= 2e+110: tmp = c + ((x * y) + t_2) else: tmp = (c + t_2) - 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) <= -5e+40) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 2e+110) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(Float64(c + t_2) - 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) <= -5e+40) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 2e+110) tmp = c + ((x * y) + t_2); else tmp = (c + t_2) - 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], -5e+40], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+110], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $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 -5 \cdot 10^{+40}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+110}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000003e40Initial program 94.7%
Taylor expanded in z around 0 88.4%
if -5.00000000000000003e40 < (*.f64 a b) < 2e110Initial program 100.0%
Taylor expanded in a around 0 97.2%
if 2e110 < (*.f64 a b) Initial program 97.4%
Taylor expanded in x around 0 92.3%
Final simplification94.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* a (* b -0.25))))
(if (<= a -1.4e+198)
t_2
(if (<= a -1e+138)
t_1
(if (<= a -6.5e+112) (* z (* t 0.0625)) (if (<= a 6e-33) 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 = a * (b * -0.25);
double tmp;
if (a <= -1.4e+198) {
tmp = t_2;
} else if (a <= -1e+138) {
tmp = t_1;
} else if (a <= -6.5e+112) {
tmp = z * (t * 0.0625);
} else if (a <= 6e-33) {
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 = a * (b * (-0.25d0))
if (a <= (-1.4d+198)) then
tmp = t_2
else if (a <= (-1d+138)) then
tmp = t_1
else if (a <= (-6.5d+112)) then
tmp = z * (t * 0.0625d0)
else if (a <= 6d-33) 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 = a * (b * -0.25);
double tmp;
if (a <= -1.4e+198) {
tmp = t_2;
} else if (a <= -1e+138) {
tmp = t_1;
} else if (a <= -6.5e+112) {
tmp = z * (t * 0.0625);
} else if (a <= 6e-33) {
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 = a * (b * -0.25) tmp = 0 if a <= -1.4e+198: tmp = t_2 elif a <= -1e+138: tmp = t_1 elif a <= -6.5e+112: tmp = z * (t * 0.0625) elif a <= 6e-33: 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(a * Float64(b * -0.25)) tmp = 0.0 if (a <= -1.4e+198) tmp = t_2; elseif (a <= -1e+138) tmp = t_1; elseif (a <= -6.5e+112) tmp = Float64(z * Float64(t * 0.0625)); elseif (a <= 6e-33) 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 = a * (b * -0.25); tmp = 0.0; if (a <= -1.4e+198) tmp = t_2; elseif (a <= -1e+138) tmp = t_1; elseif (a <= -6.5e+112) tmp = z * (t * 0.0625); elseif (a <= 6e-33) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.4e+198], t$95$2, If[LessEqual[a, -1e+138], t$95$1, If[LessEqual[a, -6.5e+112], N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-33], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+198}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{+112}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.4e198 or 6.0000000000000003e-33 < a Initial program 96.6%
Taylor expanded in z around 0 84.7%
Taylor expanded in y around inf 74.0%
associate--l+74.0%
associate-*r/74.0%
div-sub76.3%
*-commutative76.3%
associate-*r*76.3%
sub-neg76.3%
distribute-rgt-neg-in76.3%
distribute-rgt-neg-in76.3%
metadata-eval76.3%
Simplified76.3%
Taylor expanded in a around inf 55.5%
*-commutative55.5%
associate-*r*55.5%
*-commutative55.5%
Simplified55.5%
if -1.4e198 < a < -1e138 or -6.4999999999999998e112 < a < 6.0000000000000003e-33Initial program 99.3%
Taylor expanded in x around inf 54.7%
if -1e138 < a < -6.4999999999999998e112Initial program 100.0%
Taylor expanded in z around inf 33.9%
associate-*r*33.9%
*-commutative33.9%
*-commutative33.9%
*-commutative33.9%
Simplified33.9%
Taylor expanded in z around inf 33.9%
Taylor expanded in t around inf 34.0%
Final simplification54.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+40) (not (<= (* a b) 5e+90))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+40) || !((a * b) <= 5e+90)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
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) <= (-5d+40)) .or. (.not. ((a * b) <= 5d+90))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
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) <= -5e+40) || !((a * b) <= 5e+90)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+40) or not ((a * b) <= 5e+90): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+40) || !(Float64(a * b) <= 5e+90)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+40) || ~(((a * b) <= 5e+90))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+40], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+90]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+40} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+90}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000003e40 or 5.0000000000000004e90 < (*.f64 a b) Initial program 96.0%
Taylor expanded in z around 0 87.8%
if -5.00000000000000003e40 < (*.f64 a b) < 5.0000000000000004e90Initial program 100.0%
Taylor expanded in a around 0 97.7%
Final simplification93.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<= a -1.9e+197)
(+ c (* b (* a -0.25)))
(if (<= a 1.15e+29)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* y (+ x (* (* b -0.25) (/ a y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -1.9e+197) {
tmp = c + (b * (a * -0.25));
} else if (a <= 1.15e+29) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = y * (x + ((b * -0.25) * (a / 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.9d+197)) then
tmp = c + (b * (a * (-0.25d0)))
else if (a <= 1.15d+29) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = y * (x + ((b * (-0.25d0)) * (a / 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.9e+197) {
tmp = c + (b * (a * -0.25));
} else if (a <= 1.15e+29) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = y * (x + ((b * -0.25) * (a / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if a <= -1.9e+197: tmp = c + (b * (a * -0.25)) elif a <= 1.15e+29: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = y * (x + ((b * -0.25) * (a / y))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -1.9e+197) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (a <= 1.15e+29) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(y * Float64(x + Float64(Float64(b * -0.25) * Float64(a / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (a <= -1.9e+197) tmp = c + (b * (a * -0.25)); elseif (a <= 1.15e+29) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = y * (x + ((b * -0.25) * (a / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -1.9e+197], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.15e+29], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x + N[(N[(b * -0.25), $MachinePrecision] * N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+197}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+29}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + \left(b \cdot -0.25\right) \cdot \frac{a}{y}\right)\\
\end{array}
\end{array}
if a < -1.9000000000000001e197Initial program 95.0%
Taylor expanded in a around inf 95.0%
*-commutative95.0%
*-commutative95.0%
associate-*r*95.0%
Simplified95.0%
if -1.9000000000000001e197 < a < 1.1500000000000001e29Initial program 99.4%
Taylor expanded in a around 0 87.3%
if 1.1500000000000001e29 < a Initial program 96.8%
Taylor expanded in z around 0 82.8%
Taylor expanded in y around inf 75.0%
associate--l+75.0%
associate-*r/75.0%
div-sub78.3%
*-commutative78.3%
associate-*r*78.3%
sub-neg78.3%
distribute-rgt-neg-in78.3%
distribute-rgt-neg-in78.3%
metadata-eval78.3%
Simplified78.3%
Taylor expanded in c around 0 68.9%
associate-*r/68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-/l*67.3%
*-commutative67.3%
Simplified67.3%
Final simplification83.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -2.4e+24) (not (<= (* x y) 2.9e+104))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -2.4e+24) || !((x * y) <= 2.9e+104)) {
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) <= (-2.4d+24)) .or. (.not. ((x * y) <= 2.9d+104))) 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) <= -2.4e+24) || !((x * y) <= 2.9e+104)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -2.4e+24) or not ((x * y) <= 2.9e+104): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -2.4e+24) || !(Float64(x * y) <= 2.9e+104)) 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) <= -2.4e+24) || ~(((x * y) <= 2.9e+104))) 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], -2.4e+24], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.9e+104]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.4 \cdot 10^{+24} \lor \neg \left(x \cdot y \leq 2.9 \cdot 10^{+104}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -2.4000000000000001e24 or 2.8999999999999998e104 < (*.f64 x y) Initial program 97.1%
Taylor expanded in x around inf 65.3%
Taylor expanded in c around inf 58.0%
Taylor expanded in c around 0 60.0%
if -2.4000000000000001e24 < (*.f64 x y) < 2.8999999999999998e104Initial program 99.3%
Taylor expanded in c around inf 32.2%
Final simplification43.5%
(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.4%
Final simplification98.4%
(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.4%
Taylor expanded in c around inf 21.8%
herbie shell --seed 2024087
(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))