
(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 97.2%
associate-+l-97.2%
associate--l+97.2%
fma-def99.2%
associate-*l/99.2%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* t (* z 0.0625))))
(if (<= (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) INFINITY)
(+ (+ (* x y) (fma a (* b -0.25) c)) t_1)
(+ t_1 (* a (* b -0.25))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (z * 0.0625);
double tmp;
if ((((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
tmp = ((x * y) + fma(a, (b * -0.25), c)) + t_1;
} else {
tmp = t_1 + (a * (b * -0.25));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(z * 0.0625)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) <= Inf) tmp = Float64(Float64(Float64(x * y) + fma(a, Float64(b * -0.25), c)) + t_1); else tmp = Float64(t_1 + Float64(a * Float64(b * -0.25))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x * y), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\left(x \cdot y + \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 + 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%
associate-+l-100.0%
associate--l+100.0%
fma-def100.0%
associate-*l/100.0%
fma-neg100.0%
sub-neg100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-*l/100.0%
fma-udef100.0%
associate-/r/99.9%
associate-+r+99.9%
associate-*l/99.9%
fma-udef99.9%
+-commutative99.9%
fma-udef99.9%
associate-*l/99.9%
associate-+r+99.9%
div-inv100.0%
fma-def100.0%
clear-num100.0%
div-inv100.0%
metadata-eval100.0%
associate-*l/100.0%
Applied egg-rr100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
associate-+l-0.0%
associate--l+0.0%
fma-def71.4%
associate-*l/71.4%
fma-neg71.4%
sub-neg71.4%
distribute-neg-in71.4%
remove-double-neg71.4%
associate-/l*71.4%
distribute-frac-neg71.4%
associate-/r/71.4%
fma-def71.4%
neg-mul-171.4%
*-commutative71.4%
associate-/l*71.4%
metadata-eval71.4%
Simplified71.4%
fma-udef0.0%
fma-udef0.0%
associate-*l/0.0%
fma-udef0.0%
associate-/r/0.0%
associate-+r+0.0%
associate-*l/0.0%
fma-udef28.6%
+-commutative28.6%
fma-udef0.0%
associate-*l/0.0%
associate-+r+0.0%
div-inv0.0%
fma-def0.0%
clear-num0.0%
div-inv0.0%
metadata-eval0.0%
associate-*l/0.0%
Applied egg-rr0.0%
Taylor expanded in a around inf 71.4%
*-commutative71.4%
associate-*r*71.4%
*-commutative71.4%
Simplified71.4%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (* (/ z 16.0) t)) (+ c (/ a (/ -4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, ((z / 16.0) * t)) + (c + (a / (-4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(Float64(z / 16.0) * t)) + Float64(c + Float64(a / Float64(-4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) + \left(c + \frac{a}{\frac{-4}{b}}\right)
\end{array}
Initial program 97.2%
sub-neg97.2%
associate-+l+97.2%
fma-def98.0%
associate-*l/98.0%
distribute-frac-neg98.0%
distribute-rgt-neg-out98.0%
associate-/l*98.0%
neg-mul-198.0%
associate-/r*98.0%
metadata-eval98.0%
Simplified98.0%
Final simplification98.0%
(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) (+ (* t (* z 0.0625)) (* 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 = (t * (z * 0.0625)) + (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 = (t * (z * 0.0625)) + (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 = (t * (z * 0.0625)) + (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(Float64(t * Float64(z * 0.0625)) + 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 = (t * (z * 0.0625)) + (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[(N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision] + 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}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right) + 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%
associate-+l-0.0%
associate--l+0.0%
fma-def71.4%
associate-*l/71.4%
fma-neg71.4%
sub-neg71.4%
distribute-neg-in71.4%
remove-double-neg71.4%
associate-/l*71.4%
distribute-frac-neg71.4%
associate-/r/71.4%
fma-def71.4%
neg-mul-171.4%
*-commutative71.4%
associate-/l*71.4%
metadata-eval71.4%
Simplified71.4%
fma-udef0.0%
fma-udef0.0%
associate-*l/0.0%
fma-udef0.0%
associate-/r/0.0%
associate-+r+0.0%
associate-*l/0.0%
fma-udef28.6%
+-commutative28.6%
fma-udef0.0%
associate-*l/0.0%
associate-+r+0.0%
div-inv0.0%
fma-def0.0%
clear-num0.0%
div-inv0.0%
metadata-eval0.0%
associate-*l/0.0%
Applied egg-rr0.0%
Taylor expanded in a around inf 71.4%
*-commutative71.4%
associate-*r*71.4%
*-commutative71.4%
Simplified71.4%
Final simplification99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))) (t_2 (* t (* z 0.0625))) (t_3 (+ (* x y) t_2)))
(if (<= (* x y) -6.2e+91)
t_3
(if (<= (* x y) -2.35e-265)
(+ c t_1)
(if (<= (* x y) 2.2e-65) (+ t_2 t_1) t_3)))))
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 = t * (z * 0.0625);
double t_3 = (x * y) + t_2;
double tmp;
if ((x * y) <= -6.2e+91) {
tmp = t_3;
} else if ((x * y) <= -2.35e-265) {
tmp = c + t_1;
} else if ((x * y) <= 2.2e-65) {
tmp = t_2 + t_1;
} 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 = a * (b * (-0.25d0))
t_2 = t * (z * 0.0625d0)
t_3 = (x * y) + t_2
if ((x * y) <= (-6.2d+91)) then
tmp = t_3
else if ((x * y) <= (-2.35d-265)) then
tmp = c + t_1
else if ((x * y) <= 2.2d-65) then
tmp = t_2 + t_1
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 = a * (b * -0.25);
double t_2 = t * (z * 0.0625);
double t_3 = (x * y) + t_2;
double tmp;
if ((x * y) <= -6.2e+91) {
tmp = t_3;
} else if ((x * y) <= -2.35e-265) {
tmp = c + t_1;
} else if ((x * y) <= 2.2e-65) {
tmp = t_2 + t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) t_2 = t * (z * 0.0625) t_3 = (x * y) + t_2 tmp = 0 if (x * y) <= -6.2e+91: tmp = t_3 elif (x * y) <= -2.35e-265: tmp = c + t_1 elif (x * y) <= 2.2e-65: tmp = t_2 + t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) t_2 = Float64(t * Float64(z * 0.0625)) t_3 = Float64(Float64(x * y) + t_2) tmp = 0.0 if (Float64(x * y) <= -6.2e+91) tmp = t_3; elseif (Float64(x * y) <= -2.35e-265) tmp = Float64(c + t_1); elseif (Float64(x * y) <= 2.2e-65) tmp = Float64(t_2 + t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = a * (b * -0.25); t_2 = t * (z * 0.0625); t_3 = (x * y) + t_2; tmp = 0.0; if ((x * y) <= -6.2e+91) tmp = t_3; elseif ((x * y) <= -2.35e-265) tmp = c + t_1; elseif ((x * y) <= 2.2e-65) tmp = t_2 + t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.2e+91], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.35e-265], N[(c + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-65], N[(t$95$2 + t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
t_2 := t \cdot \left(z \cdot 0.0625\right)\\
t_3 := x \cdot y + t_2\\
\mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+91}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-265}:\\
\;\;\;\;c + t_1\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-65}:\\
\;\;\;\;t_2 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -6.19999999999999995e91 or 2.20000000000000021e-65 < (*.f64 x y) Initial program 94.9%
associate-+l-94.9%
associate--l+94.9%
fma-def99.2%
associate-*l/99.2%
fma-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
remove-double-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
associate-/r/99.2%
fma-def99.2%
neg-mul-199.2%
*-commutative99.2%
associate-/l*99.2%
metadata-eval99.2%
Simplified99.2%
fma-udef94.9%
fma-udef94.9%
associate-*l/94.9%
fma-udef94.9%
associate-/r/94.9%
associate-+r+94.9%
associate-*l/94.9%
fma-udef96.6%
+-commutative96.6%
fma-udef94.9%
associate-*l/94.9%
associate-+r+94.9%
div-inv94.9%
fma-def94.9%
clear-num94.9%
div-inv94.9%
metadata-eval94.9%
associate-*l/94.9%
Applied egg-rr94.9%
Taylor expanded in x around inf 82.0%
if -6.19999999999999995e91 < (*.f64 x y) < -2.34999999999999993e-265Initial program 100.0%
Taylor expanded in a around inf 77.8%
*-commutative77.8%
associate-*r*77.8%
Simplified77.8%
if -2.34999999999999993e-265 < (*.f64 x y) < 2.20000000000000021e-65Initial program 98.7%
associate-+l-98.7%
associate--l+98.7%
fma-def98.7%
associate-*l/98.7%
fma-neg98.7%
sub-neg98.7%
distribute-neg-in98.7%
remove-double-neg98.7%
associate-/l*98.6%
distribute-frac-neg98.6%
associate-/r/98.7%
fma-def98.7%
neg-mul-198.7%
*-commutative98.7%
associate-/l*98.7%
metadata-eval98.7%
Simplified98.7%
fma-udef98.7%
fma-udef98.7%
associate-*l/98.7%
fma-udef98.7%
associate-/r/98.6%
associate-+r+98.6%
associate-*l/98.6%
fma-udef98.6%
+-commutative98.6%
fma-udef98.6%
associate-*l/98.6%
associate-+r+98.6%
div-inv98.6%
fma-def98.7%
clear-num98.7%
div-inv98.7%
metadata-eval98.7%
associate-*l/98.7%
Applied egg-rr98.7%
Taylor expanded in a around inf 78.0%
*-commutative78.0%
associate-*r*78.0%
*-commutative78.0%
Simplified78.0%
Final simplification79.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (* t (* z 0.0625)))))
(if (<= (* x y) -1.6e+85)
t_1
(if (<= (* x y) -1e-320)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 6.5e+43) (+ c (* 0.0625 (* z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -1.6e+85) {
tmp = t_1;
} else if ((x * y) <= -1e-320) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 6.5e+43) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (t * (z * 0.0625d0))
if ((x * y) <= (-1.6d+85)) then
tmp = t_1
else if ((x * y) <= (-1d-320)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 6.5d+43) then
tmp = c + (0.0625d0 * (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -1.6e+85) {
tmp = t_1;
} else if ((x * y) <= -1e-320) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 6.5e+43) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) + (t * (z * 0.0625)) tmp = 0 if (x * y) <= -1.6e+85: tmp = t_1 elif (x * y) <= -1e-320: tmp = c + (a * (b * -0.25)) elif (x * y) <= 6.5e+43: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(x * y) <= -1.6e+85) tmp = t_1; elseif (Float64(x * y) <= -1e-320) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 6.5e+43) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) + (t * (z * 0.0625)); tmp = 0.0; if ((x * y) <= -1.6e+85) tmp = t_1; elseif ((x * y) <= -1e-320) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 6.5e+43) tmp = c + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+85], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-320], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+43], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.6 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-320}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+43}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.60000000000000009e85 or 6.4999999999999998e43 < (*.f64 x y) Initial program 94.1%
associate-+l-94.1%
associate--l+94.1%
fma-def99.0%
associate-*l/99.0%
fma-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
fma-udef94.1%
fma-udef94.1%
associate-*l/94.1%
fma-udef94.1%
associate-/r/94.1%
associate-+r+94.1%
associate-*l/94.1%
fma-udef96.1%
+-commutative96.1%
fma-udef94.1%
associate-*l/94.1%
associate-+r+94.1%
div-inv94.1%
fma-def94.1%
clear-num94.1%
div-inv94.1%
metadata-eval94.1%
associate-*l/94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 84.3%
if -1.60000000000000009e85 < (*.f64 x y) < -9.99989e-321Initial program 100.0%
Taylor expanded in a around inf 75.9%
*-commutative75.9%
associate-*r*75.9%
Simplified75.9%
if -9.99989e-321 < (*.f64 x y) < 6.4999999999999998e43Initial program 98.8%
Taylor expanded in z around inf 66.7%
Final simplification76.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -3.5e+87)
t_1
(if (<= (* x y) -1e-320)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 7.2e+115) (+ c (* 0.0625 (* z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -3.5e+87) {
tmp = t_1;
} else if ((x * y) <= -1e-320) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 7.2e+115) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = c + (x * y)
if ((x * y) <= (-3.5d+87)) then
tmp = t_1
else if ((x * y) <= (-1d-320)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 7.2d+115) then
tmp = c + (0.0625d0 * (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (x * y);
double tmp;
if ((x * y) <= -3.5e+87) {
tmp = t_1;
} else if ((x * y) <= -1e-320) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 7.2e+115) {
tmp = c + (0.0625 * (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (x * y) tmp = 0 if (x * y) <= -3.5e+87: tmp = t_1 elif (x * y) <= -1e-320: tmp = c + (a * (b * -0.25)) elif (x * y) <= 7.2e+115: tmp = c + (0.0625 * (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.5e+87) tmp = t_1; elseif (Float64(x * y) <= -1e-320) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 7.2e+115) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (x * y); tmp = 0.0; if ((x * y) <= -3.5e+87) tmp = t_1; elseif ((x * y) <= -1e-320) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 7.2e+115) tmp = c + (0.0625 * (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.5e+87], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-320], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.2e+115], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -3.5 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-320}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 7.2 \cdot 10^{+115}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -3.49999999999999986e87 or 7.2000000000000001e115 < (*.f64 x y) Initial program 93.7%
Taylor expanded in x around inf 76.8%
if -3.49999999999999986e87 < (*.f64 x y) < -9.99989e-321Initial program 100.0%
Taylor expanded in a around inf 75.9%
*-commutative75.9%
associate-*r*75.9%
Simplified75.9%
if -9.99989e-321 < (*.f64 x y) < 7.2000000000000001e115Initial program 98.9%
Taylor expanded in z around inf 66.5%
Final simplification72.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -8.4e+113) (not (<= (* x y) 1.6e-65)))
(+ c (+ (* x y) t_1))
(- (+ c t_1) (* (* a b) 0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -8.4e+113) || !((x * y) <= 1.6e-65)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((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) :: tmp
t_1 = 0.0625d0 * (z * t)
if (((x * y) <= (-8.4d+113)) .or. (.not. ((x * y) <= 1.6d-65))) then
tmp = c + ((x * y) + t_1)
else
tmp = (c + t_1) - ((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 = 0.0625 * (z * t);
double tmp;
if (((x * y) <= -8.4e+113) || !((x * y) <= 1.6e-65)) {
tmp = c + ((x * y) + t_1);
} else {
tmp = (c + t_1) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((x * y) <= -8.4e+113) or not ((x * y) <= 1.6e-65): tmp = c + ((x * y) + t_1) else: tmp = (c + t_1) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(x * y) <= -8.4e+113) || !(Float64(x * y) <= 1.6e-65)) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(Float64(c + t_1) - Float64(Float64(a * b) * 0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if (((x * y) <= -8.4e+113) || ~(((x * y) <= 1.6e-65))) tmp = c + ((x * y) + t_1); else tmp = (c + t_1) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -8.4e+113], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.6e-65]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$1), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -8.4 \cdot 10^{+113} \lor \neg \left(x \cdot y \leq 1.6 \cdot 10^{-65}\right):\\
\;\;\;\;c + \left(x \cdot y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c + t_1\right) - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 x y) < -8.3999999999999996e113 or 1.6e-65 < (*.f64 x y) Initial program 94.8%
Taylor expanded in a around 0 90.9%
if -8.3999999999999996e113 < (*.f64 x y) < 1.6e-65Initial program 99.3%
Taylor expanded in x around 0 96.4%
Final simplification93.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* x y) -8.4e+113)
(* x y)
(if (<= (* x y) -2.3e-271)
c
(if (<= (* x y) 2e+115) (* t (* z 0.0625)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -8.4e+113) {
tmp = x * y;
} else if ((x * y) <= -2.3e-271) {
tmp = c;
} else if ((x * y) <= 2e+115) {
tmp = t * (z * 0.0625);
} 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) <= (-8.4d+113)) then
tmp = x * y
else if ((x * y) <= (-2.3d-271)) then
tmp = c
else if ((x * y) <= 2d+115) then
tmp = t * (z * 0.0625d0)
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) <= -8.4e+113) {
tmp = x * y;
} else if ((x * y) <= -2.3e-271) {
tmp = c;
} else if ((x * y) <= 2e+115) {
tmp = t * (z * 0.0625);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -8.4e+113: tmp = x * y elif (x * y) <= -2.3e-271: tmp = c elif (x * y) <= 2e+115: tmp = t * (z * 0.0625) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -8.4e+113) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.3e-271) tmp = c; elseif (Float64(x * y) <= 2e+115) tmp = Float64(t * Float64(z * 0.0625)); 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) <= -8.4e+113) tmp = x * y; elseif ((x * y) <= -2.3e-271) tmp = c; elseif ((x * y) <= 2e+115) tmp = t * (z * 0.0625); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -8.4e+113], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.3e-271], c, If[LessEqual[N[(x * y), $MachinePrecision], 2e+115], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.4 \cdot 10^{+113}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-271}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+115}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.3999999999999996e113 or 2e115 < (*.f64 x y) Initial program 93.4%
associate-+l-93.4%
associate--l+93.4%
fma-def98.9%
associate-*l/98.9%
fma-neg98.9%
sub-neg98.9%
distribute-neg-in98.9%
remove-double-neg98.9%
associate-/l*98.9%
distribute-frac-neg98.9%
associate-/r/98.9%
fma-def98.9%
neg-mul-198.9%
*-commutative98.9%
associate-/l*98.9%
metadata-eval98.9%
Simplified98.9%
fma-udef93.4%
fma-udef93.4%
associate-*l/93.4%
fma-udef93.4%
associate-/r/93.4%
associate-+r+93.4%
associate-*l/93.4%
fma-udef95.6%
+-commutative95.6%
fma-udef93.4%
associate-*l/93.4%
associate-+r+93.4%
div-inv93.4%
fma-def93.4%
clear-num93.4%
div-inv93.4%
metadata-eval93.4%
associate-*l/93.4%
Applied egg-rr93.4%
Taylor expanded in x around inf 84.6%
Taylor expanded in x around inf 74.1%
if -8.3999999999999996e113 < (*.f64 x y) < -2.30000000000000009e-271Initial program 100.0%
Taylor expanded in c around inf 49.0%
if -2.30000000000000009e-271 < (*.f64 x y) < 2e115Initial program 99.0%
associate-+l-99.0%
associate--l+99.0%
fma-def99.0%
associate-*l/99.0%
fma-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
associate-/l*98.9%
distribute-frac-neg98.9%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
fma-udef99.0%
fma-udef99.0%
associate-*l/99.0%
fma-udef99.0%
associate-/r/98.9%
associate-+r+98.9%
associate-*l/98.9%
fma-udef98.9%
+-commutative98.9%
fma-udef98.9%
associate-*l/98.9%
associate-+r+98.9%
div-inv99.0%
fma-def99.0%
clear-num99.0%
div-inv99.0%
metadata-eval99.0%
associate-*l/99.0%
Applied egg-rr99.0%
Taylor expanded in t around inf 45.5%
*-commutative45.5%
associate-*r*45.5%
*-commutative45.5%
Simplified45.5%
Final simplification56.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* a b) -2e+263)
(+ (* t (* z 0.0625)) t_1)
(if (<= (* a b) 2e+190) (+ c (+ (* x y) (* 0.0625 (* z t)))) (+ c 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 tmp;
if ((a * b) <= -2e+263) {
tmp = (t * (z * 0.0625)) + t_1;
} else if ((a * b) <= 2e+190) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = a * (b * (-0.25d0))
if ((a * b) <= (-2d+263)) then
tmp = (t * (z * 0.0625d0)) + t_1
else if ((a * b) <= 2d+190) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + 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 tmp;
if ((a * b) <= -2e+263) {
tmp = (t * (z * 0.0625)) + t_1;
} else if ((a * b) <= 2e+190) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = a * (b * -0.25) tmp = 0 if (a * b) <= -2e+263: tmp = (t * (z * 0.0625)) + t_1 elif (a * b) <= 2e+190: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(b * -0.25)) tmp = 0.0 if (Float64(a * b) <= -2e+263) tmp = Float64(Float64(t * Float64(z * 0.0625)) + t_1); elseif (Float64(a * b) <= 2e+190) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + t_1); 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 ((a * b) <= -2e+263) tmp = (t * (z * 0.0625)) + t_1; elseif ((a * b) <= 2e+190) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + t_1; 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[(a * b), $MachinePrecision], -2e+263], N[(N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e+190], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+263}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right) + t_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+190}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000003e263Initial program 88.2%
associate-+l-88.2%
associate--l+88.2%
fma-def88.2%
associate-*l/88.2%
fma-neg88.2%
sub-neg88.2%
distribute-neg-in88.2%
remove-double-neg88.2%
associate-/l*88.1%
distribute-frac-neg88.1%
associate-/r/88.2%
fma-def88.2%
neg-mul-188.2%
*-commutative88.2%
associate-/l*88.2%
metadata-eval88.2%
Simplified88.2%
fma-udef88.2%
fma-udef88.2%
associate-*l/88.2%
fma-udef88.2%
associate-/r/88.1%
associate-+r+88.1%
associate-*l/88.1%
fma-udef88.1%
+-commutative88.1%
fma-udef88.1%
associate-*l/88.1%
associate-+r+88.1%
div-inv88.2%
fma-def88.2%
clear-num88.2%
div-inv88.2%
metadata-eval88.2%
associate-*l/88.2%
Applied egg-rr88.2%
Taylor expanded in a around inf 88.2%
*-commutative88.2%
associate-*r*88.2%
*-commutative88.2%
Simplified88.2%
if -2.00000000000000003e263 < (*.f64 a b) < 2.0000000000000001e190Initial program 99.0%
Taylor expanded in a around 0 89.8%
if 2.0000000000000001e190 < (*.f64 a b) Initial program 89.3%
Taylor expanded in a around inf 96.4%
*-commutative96.4%
associate-*r*96.4%
Simplified96.4%
Final simplification90.4%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.02e+114) (not (<= (* x y) 7.2e+115))) (+ c (* x y)) (+ c (* 0.0625 (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -1.02e+114) || !((x * y) <= 7.2e+115)) {
tmp = c + (x * y);
} else {
tmp = c + (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 (((x * y) <= (-1.02d+114)) .or. (.not. ((x * y) <= 7.2d+115))) then
tmp = c + (x * y)
else
tmp = c + (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 (((x * y) <= -1.02e+114) || !((x * y) <= 7.2e+115)) {
tmp = c + (x * y);
} else {
tmp = c + (0.0625 * (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.02e+114) or not ((x * y) <= 7.2e+115): tmp = c + (x * y) else: tmp = c + (0.0625 * (z * t)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -1.02e+114) || !(Float64(x * y) <= 7.2e+115)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + 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 (((x * y) <= -1.02e+114) || ~(((x * y) <= 7.2e+115))) tmp = c + (x * y); else tmp = c + (0.0625 * (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.02e+114], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.2e+115]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.02 \cdot 10^{+114} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+115}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.01999999999999999e114 or 7.2000000000000001e115 < (*.f64 x y) Initial program 93.4%
Taylor expanded in x around inf 78.1%
if -1.01999999999999999e114 < (*.f64 x y) < 7.2000000000000001e115Initial program 99.4%
Taylor expanded in z around inf 66.8%
Final simplification70.9%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -1.01e+114) (not (<= (* x y) 7.2e+39))) (* 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.01e+114) || !((x * y) <= 7.2e+39)) {
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.01d+114)) .or. (.not. ((x * y) <= 7.2d+39))) 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.01e+114) || !((x * y) <= 7.2e+39)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -1.01e+114) or not ((x * y) <= 7.2e+39): 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.01e+114) || !(Float64(x * y) <= 7.2e+39)) 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.01e+114) || ~(((x * y) <= 7.2e+39))) 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.01e+114], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.2e+39]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.01 \cdot 10^{+114} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+39}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00999999999999993e114 or 7.19999999999999969e39 < (*.f64 x y) Initial program 94.0%
associate-+l-94.0%
associate--l+94.0%
fma-def99.0%
associate-*l/99.0%
fma-neg99.0%
sub-neg99.0%
distribute-neg-in99.0%
remove-double-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
associate-/r/99.0%
fma-def99.0%
neg-mul-199.0%
*-commutative99.0%
associate-/l*99.0%
metadata-eval99.0%
Simplified99.0%
fma-udef94.0%
fma-udef94.0%
associate-*l/94.0%
fma-udef94.0%
associate-/r/94.0%
associate-+r+94.0%
associate-*l/94.0%
fma-udef96.0%
+-commutative96.0%
fma-udef94.0%
associate-*l/94.0%
associate-+r+94.0%
div-inv94.0%
fma-def94.0%
clear-num94.0%
div-inv94.0%
metadata-eval94.0%
associate-*l/94.0%
Applied egg-rr94.0%
Taylor expanded in x around inf 84.9%
Taylor expanded in x around inf 71.3%
if -1.00999999999999993e114 < (*.f64 x y) < 7.19999999999999969e39Initial program 99.3%
Taylor expanded in c around inf 34.0%
Final simplification48.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= t -2.3e-53) (not (<= t 5.4e+174))) (* t (* z 0.0625)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -2.3e-53) || !(t <= 5.4e+174)) {
tmp = t * (z * 0.0625);
} 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 ((t <= (-2.3d-53)) .or. (.not. (t <= 5.4d+174))) then
tmp = t * (z * 0.0625d0)
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 ((t <= -2.3e-53) || !(t <= 5.4e+174)) {
tmp = t * (z * 0.0625);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -2.3e-53) or not (t <= 5.4e+174): tmp = t * (z * 0.0625) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -2.3e-53) || !(t <= 5.4e+174)) tmp = Float64(t * Float64(z * 0.0625)); 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 ((t <= -2.3e-53) || ~((t <= 5.4e+174))) tmp = t * (z * 0.0625); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -2.3e-53], N[Not[LessEqual[t, 5.4e+174]], $MachinePrecision]], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-53} \lor \neg \left(t \leq 5.4 \cdot 10^{+174}\right):\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if t < -2.3000000000000001e-53 or 5.3999999999999998e174 < t Initial program 94.9%
associate-+l-94.9%
associate--l+94.9%
fma-def98.0%
associate-*l/98.0%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*97.9%
distribute-frac-neg97.9%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*98.0%
metadata-eval98.0%
Simplified98.0%
fma-udef94.9%
fma-udef94.9%
associate-*l/94.9%
fma-udef94.9%
associate-/r/94.9%
associate-+r+94.9%
associate-*l/94.9%
fma-udef96.9%
+-commutative96.9%
fma-udef94.9%
associate-*l/94.9%
associate-+r+94.9%
div-inv94.9%
fma-def94.9%
clear-num94.9%
div-inv94.9%
metadata-eval94.9%
associate-*l/94.9%
Applied egg-rr94.9%
Taylor expanded in t around inf 52.3%
*-commutative52.3%
associate-*r*52.3%
*-commutative52.3%
Simplified52.3%
if -2.3000000000000001e-53 < t < 5.3999999999999998e174Initial program 98.7%
Taylor expanded in x around inf 63.5%
Final simplification59.2%
(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 97.2%
Taylor expanded in c around inf 23.4%
Final simplification23.4%
herbie shell --seed 2024019
(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))