
(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 16 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 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)))) (if (<= t_1 INFINITY) (+ c t_1) (fma a (* b -0.25) (fma x y c)))))
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 = fma(a, (b * -0.25), fma(x, y, c));
}
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 = fma(a, Float64(b * -0.25), fma(x, y, c)); end return 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[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $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}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\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%
fma-def20.0%
*-commutative20.0%
associate-/l*20.0%
associate-/l*20.0%
Simplified20.0%
fma-udef0.0%
div-inv0.0%
clear-num0.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in t around 0 30.0%
cancel-sign-sub-inv30.0%
+-commutative30.0%
fma-udef30.0%
metadata-eval30.0%
*-commutative30.0%
associate-*r*30.0%
+-commutative30.0%
fma-def60.0%
Simplified60.0%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
function code(x, y, z, t, a, b, c) return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Initial program 96.1%
associate-+l-96.1%
associate--l+96.1%
fma-def97.2%
associate-*l/97.2%
fma-neg98.0%
sub-neg98.0%
distribute-neg-in98.0%
remove-double-neg98.0%
associate-/l*98.0%
distribute-frac-neg98.0%
associate-/r/98.0%
fma-def98.0%
neg-mul-198.0%
*-commutative98.0%
associate-/l*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) (+ c (fma z (* t 0.0625) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + fma(z, (t * 0.0625), (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + fma(z, Float64(t * 0.0625), Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;c + t_1\\
\mathbf{else}:\\
\;\;\;\;c + \mathsf{fma}\left(z, t \cdot 0.0625, x \cdot y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) (/.f64 (*.f64 a b) 4)) Initial program 0.0%
Taylor expanded in a around 0 40.0%
*-commutative40.0%
*-commutative40.0%
associate-*l*40.0%
fma-def50.0%
*-commutative50.0%
Simplified50.0%
Final simplification98.0%
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (/ t (/ 16.0 z))) (- 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, (t / (16.0 / z))) + (c - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, Float64(t / Float64(16.0 / z))) + Float64(c - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(t / N[(16.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 96.1%
associate-+l-96.1%
fma-def96.9%
*-commutative96.9%
associate-/l*96.8%
associate-/l*96.8%
Simplified96.8%
Final simplification96.8%
(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) (* x y))))
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 = x * y;
}
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 = x * y;
}
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 = x * y 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(x * y); 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 = x * y; 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[(x * y), $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}:\\
\;\;\;\;x \cdot y\\
\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%
fma-def20.0%
*-commutative20.0%
associate-/l*20.0%
associate-/l*20.0%
Simplified20.0%
fma-udef0.0%
div-inv0.0%
clear-num0.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 40.7%
Final simplification97.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (- (* x y) (* (* a b) 0.25))))
(if (<= (* x y) -5.8e+163)
t_2
(if (<= (* x y) 1.2e-89)
t_1
(if (<= (* x y) 5.5e+46)
(+ c (* (* a b) -0.25))
(if (<= (* x y) 1.75e+102) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5.8e+163) {
tmp = t_2;
} else if ((x * y) <= 1.2e-89) {
tmp = t_1;
} else if ((x * y) <= 5.5e+46) {
tmp = c + ((a * b) * -0.25);
} else if ((x * y) <= 1.75e+102) {
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 + (t * (z * 0.0625d0))
t_2 = (x * y) - ((a * b) * 0.25d0)
if ((x * y) <= (-5.8d+163)) then
tmp = t_2
else if ((x * y) <= 1.2d-89) then
tmp = t_1
else if ((x * y) <= 5.5d+46) then
tmp = c + ((a * b) * (-0.25d0))
else if ((x * y) <= 1.75d+102) 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 + (t * (z * 0.0625));
double t_2 = (x * y) - ((a * b) * 0.25);
double tmp;
if ((x * y) <= -5.8e+163) {
tmp = t_2;
} else if ((x * y) <= 1.2e-89) {
tmp = t_1;
} else if ((x * y) <= 5.5e+46) {
tmp = c + ((a * b) * -0.25);
} else if ((x * y) <= 1.75e+102) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) t_2 = (x * y) - ((a * b) * 0.25) tmp = 0 if (x * y) <= -5.8e+163: tmp = t_2 elif (x * y) <= 1.2e-89: tmp = t_1 elif (x * y) <= 5.5e+46: tmp = c + ((a * b) * -0.25) elif (x * y) <= 1.75e+102: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) t_2 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -5.8e+163) tmp = t_2; elseif (Float64(x * y) <= 1.2e-89) tmp = t_1; elseif (Float64(x * y) <= 5.5e+46) tmp = Float64(c + Float64(Float64(a * b) * -0.25)); elseif (Float64(x * y) <= 1.75e+102) 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 + (t * (z * 0.0625)); t_2 = (x * y) - ((a * b) * 0.25); tmp = 0.0; if ((x * y) <= -5.8e+163) tmp = t_2; elseif ((x * y) <= 1.2e-89) tmp = t_1; elseif ((x * y) <= 5.5e+46) tmp = c + ((a * b) * -0.25); elseif ((x * y) <= 1.75e+102) 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[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e+163], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e-89], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+46], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.75e+102], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+163}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+46}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;x \cdot y \leq 1.75 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.79999999999999996e163 or 1.75000000000000005e102 < (*.f64 x y) Initial program 90.5%
Taylor expanded in z around 0 82.9%
Taylor expanded in c around 0 80.3%
if -5.79999999999999996e163 < (*.f64 x y) < 1.20000000000000008e-89 or 5.4999999999999998e46 < (*.f64 x y) < 1.75000000000000005e102Initial program 98.0%
Taylor expanded in z around inf 72.2%
associate-*r*72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
if 1.20000000000000008e-89 < (*.f64 x y) < 5.4999999999999998e46Initial program 100.0%
Taylor expanded in a around inf 70.1%
*-commutative70.1%
Simplified70.1%
Final simplification74.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))))
(if (<= (* x y) -2.2e+168)
(* x y)
(if (<= (* x y) 7.6e-91)
t_1
(if (<= (* x y) 1.2e+49)
(+ c (* (* a b) -0.25))
(if (<= (* x y) 2.15e+102) t_1 (+ c (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -2.2e+168) {
tmp = x * y;
} else if ((x * y) <= 7.6e-91) {
tmp = t_1;
} else if ((x * y) <= 1.2e+49) {
tmp = c + ((a * b) * -0.25);
} else if ((x * y) <= 2.15e+102) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = c + (t * (z * 0.0625d0))
if ((x * y) <= (-2.2d+168)) then
tmp = x * y
else if ((x * y) <= 7.6d-91) then
tmp = t_1
else if ((x * y) <= 1.2d+49) then
tmp = c + ((a * b) * (-0.25d0))
else if ((x * y) <= 2.15d+102) then
tmp = t_1
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 t_1 = c + (t * (z * 0.0625));
double tmp;
if ((x * y) <= -2.2e+168) {
tmp = x * y;
} else if ((x * y) <= 7.6e-91) {
tmp = t_1;
} else if ((x * y) <= 1.2e+49) {
tmp = c + ((a * b) * -0.25);
} else if ((x * y) <= 2.15e+102) {
tmp = t_1;
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (t * (z * 0.0625)) tmp = 0 if (x * y) <= -2.2e+168: tmp = x * y elif (x * y) <= 7.6e-91: tmp = t_1 elif (x * y) <= 1.2e+49: tmp = c + ((a * b) * -0.25) elif (x * y) <= 2.15e+102: tmp = t_1 else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(t * Float64(z * 0.0625))) tmp = 0.0 if (Float64(x * y) <= -2.2e+168) tmp = Float64(x * y); elseif (Float64(x * y) <= 7.6e-91) tmp = t_1; elseif (Float64(x * y) <= 1.2e+49) tmp = Float64(c + Float64(Float64(a * b) * -0.25)); elseif (Float64(x * y) <= 2.15e+102) tmp = t_1; else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (t * (z * 0.0625)); tmp = 0.0; if ((x * y) <= -2.2e+168) tmp = x * y; elseif ((x * y) <= 7.6e-91) tmp = t_1; elseif ((x * y) <= 1.2e+49) tmp = c + ((a * b) * -0.25); elseif ((x * y) <= 2.15e+102) tmp = t_1; else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+168], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.6e-91], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+49], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.15e+102], t$95$1, N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -2.2 \cdot 10^{+168}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 7.6 \cdot 10^{-91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+49}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.2000000000000002e168Initial program 89.6%
associate-+l-89.6%
fma-def89.6%
*-commutative89.6%
associate-/l*89.6%
associate-/l*89.6%
Simplified89.6%
fma-udef89.6%
div-inv89.6%
clear-num89.6%
div-inv89.6%
metadata-eval89.6%
Applied egg-rr89.6%
Taylor expanded in x around inf 77.6%
if -2.2000000000000002e168 < (*.f64 x y) < 7.59999999999999957e-91 or 1.2e49 < (*.f64 x y) < 2.15e102Initial program 98.0%
Taylor expanded in z around inf 71.8%
associate-*r*71.8%
*-commutative71.8%
associate-*r*71.8%
Simplified71.8%
if 7.59999999999999957e-91 < (*.f64 x y) < 1.2e49Initial program 100.0%
Taylor expanded in a around inf 70.1%
*-commutative70.1%
Simplified70.1%
if 2.15e102 < (*.f64 x y) Initial program 90.9%
Taylor expanded in x around inf 74.0%
Final simplification72.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (<= (* x y) -1.15e+164)
(* x y)
(if (<= (* x y) 0.004)
t_1
(if (<= (* x y) 7.5e+25) c (if (<= (* x y) 1.2e+102) t_1 (* x y)))))))
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) <= -1.15e+164) {
tmp = x * y;
} else if ((x * y) <= 0.004) {
tmp = t_1;
} else if ((x * y) <= 7.5e+25) {
tmp = c;
} else if ((x * y) <= 1.2e+102) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
if ((x * y) <= (-1.15d+164)) then
tmp = x * y
else if ((x * y) <= 0.004d0) then
tmp = t_1
else if ((x * y) <= 7.5d+25) then
tmp = c
else if ((x * y) <= 1.2d+102) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -1.15e+164) {
tmp = x * y;
} else if ((x * y) <= 0.004) {
tmp = t_1;
} else if ((x * y) <= 7.5e+25) {
tmp = c;
} else if ((x * y) <= 1.2e+102) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if (x * y) <= -1.15e+164: tmp = x * y elif (x * y) <= 0.004: tmp = t_1 elif (x * y) <= 7.5e+25: tmp = c elif (x * y) <= 1.2e+102: tmp = t_1 else: tmp = x * y 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) <= -1.15e+164) tmp = Float64(x * y); elseif (Float64(x * y) <= 0.004) tmp = t_1; elseif (Float64(x * y) <= 7.5e+25) tmp = c; elseif (Float64(x * y) <= 1.2e+102) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); tmp = 0.0; if ((x * y) <= -1.15e+164) tmp = x * y; elseif ((x * y) <= 0.004) tmp = t_1; elseif ((x * y) <= 7.5e+25) tmp = c; elseif ((x * y) <= 1.2e+102) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.15e+164], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.004], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7.5e+25], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+102], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+164}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 0.004:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15e164 or 1.19999999999999997e102 < (*.f64 x y) Initial program 90.4%
associate-+l-90.4%
fma-def93.1%
*-commutative93.1%
associate-/l*93.1%
associate-/l*93.1%
Simplified93.1%
fma-udef90.4%
div-inv90.4%
clear-num90.4%
div-inv90.4%
metadata-eval90.4%
Applied egg-rr90.4%
Taylor expanded in x around inf 72.7%
if -1.15e164 < (*.f64 x y) < 0.0040000000000000001 or 7.49999999999999993e25 < (*.f64 x y) < 1.19999999999999997e102Initial program 98.2%
associate-+l-98.2%
fma-def98.2%
*-commutative98.2%
associate-/l*98.1%
associate-/l*98.1%
Simplified98.1%
fma-udef98.1%
div-inv98.1%
clear-num98.2%
div-inv98.2%
metadata-eval98.2%
Applied egg-rr98.2%
Taylor expanded in t around inf 43.6%
if 0.0040000000000000001 < (*.f64 x y) < 7.49999999999999993e25Initial program 100.0%
Taylor expanded in c around inf 57.7%
Final simplification52.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -4e+97) (not (<= (* x y) 1.1e+79)))
(+ 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) <= -4e+97) || !((x * y) <= 1.1e+79)) {
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) <= (-4d+97)) .or. (.not. ((x * y) <= 1.1d+79))) 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) <= -4e+97) || !((x * y) <= 1.1e+79)) {
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) <= -4e+97) or not ((x * y) <= 1.1e+79): 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) <= -4e+97) || !(Float64(x * y) <= 1.1e+79)) 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) <= -4e+97) || ~(((x * y) <= 1.1e+79))) 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], -4e+97], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+79]], $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 -4 \cdot 10^{+97} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+79}\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) < -4.0000000000000003e97 or 1.0999999999999999e79 < (*.f64 x y) Initial program 90.8%
Taylor expanded in a around 0 83.5%
if -4.0000000000000003e97 < (*.f64 x y) < 1.0999999999999999e79Initial program 98.8%
Taylor expanded in x around 0 94.1%
Final simplification90.5%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -8.5e+133)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 4e+164)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* (* a b) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -8.5e+133) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 4e+164) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-8.5d+133)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 4d+164) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + ((a * b) * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -8.5e+133) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 4e+164) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + ((a * b) * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -8.5e+133: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 4e+164: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + ((a * b) * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -8.5e+133) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 4e+164) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(Float64(a * b) * -0.25)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a * b) <= -8.5e+133) tmp = (x * y) - ((a * b) * 0.25); elseif ((a * b) <= 4e+164) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = c + ((a * b) * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -8.5e+133], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+164], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{+133}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+164}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(a \cdot b\right) \cdot -0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -8.50000000000000044e133Initial program 85.7%
Taylor expanded in z around 0 83.2%
Taylor expanded in c around 0 77.5%
if -8.50000000000000044e133 < (*.f64 a b) < 4e164Initial program 98.4%
Taylor expanded in a around 0 90.9%
if 4e164 < (*.f64 a b) Initial program 92.6%
Taylor expanded in a around inf 85.5%
*-commutative85.5%
Simplified85.5%
Final simplification88.5%
(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) -4e+133)
(- (* x y) t_1)
(if (<= (* a b) 1.3e+179) (+ c (+ (* x y) t_2)) (- 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) <= -4e+133) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 1.3e+179) {
tmp = c + ((x * y) + t_2);
} else {
tmp = 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) <= (-4d+133)) then
tmp = (x * y) - t_1
else if ((a * b) <= 1.3d+179) then
tmp = c + ((x * y) + t_2)
else
tmp = 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) <= -4e+133) {
tmp = (x * y) - t_1;
} else if ((a * b) <= 1.3e+179) {
tmp = c + ((x * y) + t_2);
} else {
tmp = 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) <= -4e+133: tmp = (x * y) - t_1 elif (a * b) <= 1.3e+179: tmp = c + ((x * y) + t_2) else: tmp = 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) <= -4e+133) tmp = Float64(Float64(x * y) - t_1); elseif (Float64(a * b) <= 1.3e+179) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(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) <= -4e+133) tmp = (x * y) - t_1; elseif ((a * b) <= 1.3e+179) tmp = c + ((x * y) + t_2); else tmp = 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], -4e+133], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.3e+179], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - 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 -4 \cdot 10^{+133}:\\
\;\;\;\;x \cdot y - t_1\\
\mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{+179}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.0000000000000001e133Initial program 85.7%
Taylor expanded in z around 0 83.2%
Taylor expanded in c around 0 77.5%
if -4.0000000000000001e133 < (*.f64 a b) < 1.3000000000000001e179Initial program 98.4%
Taylor expanded in a around 0 91.0%
if 1.3000000000000001e179 < (*.f64 a b) Initial program 92.3%
Taylor expanded in x around 0 92.3%
Taylor expanded in c around 0 92.3%
Final simplification89.3%
(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) -1.14e+133)
(- (+ c (* x y)) t_1)
(if (<= (* a b) 1.8e+167) (+ c (+ (* x y) t_2)) (- 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) <= -1.14e+133) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 1.8e+167) {
tmp = c + ((x * y) + t_2);
} else {
tmp = 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) <= (-1.14d+133)) then
tmp = (c + (x * y)) - t_1
else if ((a * b) <= 1.8d+167) then
tmp = c + ((x * y) + t_2)
else
tmp = 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) <= -1.14e+133) {
tmp = (c + (x * y)) - t_1;
} else if ((a * b) <= 1.8e+167) {
tmp = c + ((x * y) + t_2);
} else {
tmp = 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) <= -1.14e+133: tmp = (c + (x * y)) - t_1 elif (a * b) <= 1.8e+167: tmp = c + ((x * y) + t_2) else: tmp = 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) <= -1.14e+133) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(a * b) <= 1.8e+167) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(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) <= -1.14e+133) tmp = (c + (x * y)) - t_1; elseif ((a * b) <= 1.8e+167) tmp = c + ((x * y) + t_2); else tmp = 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], -1.14e+133], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.8e+167], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1.14 \cdot 10^{+133}:\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\
\mathbf{elif}\;a \cdot b \leq 1.8 \cdot 10^{+167}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.14e133Initial program 85.7%
Taylor expanded in z around 0 83.2%
if -1.14e133 < (*.f64 a b) < 1.80000000000000012e167Initial program 98.4%
Taylor expanded in a around 0 91.0%
if 1.80000000000000012e167 < (*.f64 a b) Initial program 92.3%
Taylor expanded in x around 0 92.3%
Taylor expanded in c around 0 92.3%
Final simplification90.0%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -6e+174) (* x y) (if (<= (* x y) 6.2e+101) (+ c (* 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 ((x * y) <= -6e+174) {
tmp = x * y;
} else if ((x * y) <= 6.2e+101) {
tmp = c + (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 ((x * y) <= (-6d+174)) then
tmp = x * y
else if ((x * y) <= 6.2d+101) then
tmp = c + (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 ((x * y) <= -6e+174) {
tmp = x * y;
} else if ((x * y) <= 6.2e+101) {
tmp = c + (t * (z * 0.0625));
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -6e+174: tmp = x * y elif (x * y) <= 6.2e+101: tmp = c + (t * (z * 0.0625)) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -6e+174) tmp = Float64(x * y); elseif (Float64(x * y) <= 6.2e+101) tmp = Float64(c + 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 ((x * y) <= -6e+174) tmp = x * y; elseif ((x * y) <= 6.2e+101) tmp = c + (t * (z * 0.0625)); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -6e+174], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.2e+101], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6 \cdot 10^{+174}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 6.2 \cdot 10^{+101}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6e174Initial program 89.6%
associate-+l-89.6%
fma-def89.6%
*-commutative89.6%
associate-/l*89.6%
associate-/l*89.6%
Simplified89.6%
fma-udef89.6%
div-inv89.6%
clear-num89.6%
div-inv89.6%
metadata-eval89.6%
Applied egg-rr89.6%
Taylor expanded in x around inf 77.6%
if -6e174 < (*.f64 x y) < 6.19999999999999998e101Initial program 98.3%
Taylor expanded in z around inf 69.2%
associate-*r*69.2%
*-commutative69.2%
associate-*r*69.2%
Simplified69.2%
if 6.19999999999999998e101 < (*.f64 x y) Initial program 90.9%
Taylor expanded in x around inf 74.0%
Final simplification71.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* z t))))
(if (<= z -3.4e+186)
t_2
(if (<= z -2.6e-50)
t_1
(if (<= z -3.8e-106) (* (* a b) -0.25) (if (<= z 2.2e-99) 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 = 0.0625 * (z * t);
double tmp;
if (z <= -3.4e+186) {
tmp = t_2;
} else if (z <= -2.6e-50) {
tmp = t_1;
} else if (z <= -3.8e-106) {
tmp = (a * b) * -0.25;
} else if (z <= 2.2e-99) {
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 = 0.0625d0 * (z * t)
if (z <= (-3.4d+186)) then
tmp = t_2
else if (z <= (-2.6d-50)) then
tmp = t_1
else if (z <= (-3.8d-106)) then
tmp = (a * b) * (-0.25d0)
else if (z <= 2.2d-99) 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 = 0.0625 * (z * t);
double tmp;
if (z <= -3.4e+186) {
tmp = t_2;
} else if (z <= -2.6e-50) {
tmp = t_1;
} else if (z <= -3.8e-106) {
tmp = (a * b) * -0.25;
} else if (z <= 2.2e-99) {
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 = 0.0625 * (z * t) tmp = 0 if z <= -3.4e+186: tmp = t_2 elif z <= -2.6e-50: tmp = t_1 elif z <= -3.8e-106: tmp = (a * b) * -0.25 elif z <= 2.2e-99: 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(0.0625 * Float64(z * t)) tmp = 0.0 if (z <= -3.4e+186) tmp = t_2; elseif (z <= -2.6e-50) tmp = t_1; elseif (z <= -3.8e-106) tmp = Float64(Float64(a * b) * -0.25); elseif (z <= 2.2e-99) 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 = 0.0625 * (z * t); tmp = 0.0; if (z <= -3.4e+186) tmp = t_2; elseif (z <= -2.6e-50) tmp = t_1; elseif (z <= -3.8e-106) tmp = (a * b) * -0.25; elseif (z <= 2.2e-99) 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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+186], t$95$2, If[LessEqual[z, -2.6e-50], t$95$1, If[LessEqual[z, -3.8e-106], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[z, 2.2e-99], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+186}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-106}:\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.40000000000000005e186 or 2.20000000000000004e-99 < z Initial program 97.3%
associate-+l-97.3%
fma-def97.3%
*-commutative97.3%
associate-/l*97.1%
associate-/l*97.1%
Simplified97.1%
fma-udef97.1%
div-inv97.2%
clear-num97.3%
div-inv97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in t around inf 52.3%
if -3.40000000000000005e186 < z < -2.6000000000000001e-50 or -3.7999999999999999e-106 < z < 2.20000000000000004e-99Initial program 94.6%
Taylor expanded in x around inf 58.6%
if -2.6000000000000001e-50 < z < -3.7999999999999999e-106Initial program 100.0%
associate-+l-100.0%
fma-def100.0%
*-commutative100.0%
associate-/l*99.8%
associate-/l*99.7%
Simplified99.7%
fma-udef99.7%
div-inv99.7%
clear-num99.9%
div-inv99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 41.7%
*-commutative41.7%
Simplified41.7%
Final simplification54.9%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -2.3e+82) (* x y) (if (<= (* x y) 5.4e+101) c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -2.3e+82) {
tmp = x * y;
} else if ((x * y) <= 5.4e+101) {
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) :: tmp
if ((x * y) <= (-2.3d+82)) then
tmp = x * y
else if ((x * y) <= 5.4d+101) 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 tmp;
if ((x * y) <= -2.3e+82) {
tmp = x * y;
} else if ((x * y) <= 5.4e+101) {
tmp = c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -2.3e+82: tmp = x * y elif (x * y) <= 5.4e+101: tmp = c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -2.3e+82) tmp = Float64(x * y); elseif (Float64(x * y) <= 5.4e+101) tmp = c; 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) <= -2.3e+82) tmp = x * y; elseif ((x * y) <= 5.4e+101) tmp = c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.3e+82], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.4e+101], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+82}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+101}:\\
\;\;\;\;c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.29999999999999988e82 or 5.40000000000000012e101 < (*.f64 x y) Initial program 90.7%
associate-+l-90.7%
fma-def93.0%
*-commutative93.0%
associate-/l*93.0%
associate-/l*93.0%
Simplified93.0%
fma-udef90.7%
div-inv90.6%
clear-num90.7%
div-inv90.7%
metadata-eval90.7%
Applied egg-rr90.7%
Taylor expanded in x around inf 64.4%
if -2.29999999999999988e82 < (*.f64 x y) < 5.40000000000000012e101Initial program 98.8%
Taylor expanded in c around inf 31.1%
Final simplification42.3%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.1%
Taylor expanded in c around inf 22.6%
Final simplification22.6%
herbie shell --seed 2023279
(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))