
(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 (* b (/ a -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 / 16.0), t, (b * (a / -4.0)))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(Float64(z / 16.0), t, Float64(b * Float64(a / -4.0)))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(b * N[(a / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, b \cdot \frac{a}{-4}\right)\right) + c
\end{array}
Initial program 98.8%
associate--l+98.8%
fma-define99.2%
associate-*l/99.2%
fma-neg99.2%
neg-mul-199.2%
*-commutative99.2%
associate-*l/99.2%
associate-/l*99.2%
*-commutative99.2%
associate-*r/99.2%
metadata-eval99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (/ z (/ 16.0 t))) (/ a (/ 4.0 b)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z / (16.0 / t))) - (a / (4.0 / b)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z / Float64(16.0 / t))) - Float64(a / Float64(4.0 / b)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) - \frac{a}{\frac{4}{b}}\right)
\end{array}
Initial program 98.8%
associate-+l-98.8%
*-commutative98.8%
associate-+l-98.8%
fma-define99.2%
*-commutative99.2%
associate-/l*99.2%
associate-/l*99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -3e+26)
(* x y)
(if (<= (* x y) -4e-183)
t_1
(if (<= (* x y) -1.05e-307)
c
(if (<= (* x y) 2e-317)
t_1
(if (<= (* x y) 4.5e-205)
c
(if (<= (* x y) 2.5e+68) t_1 (* 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) <= -3e+26) {
tmp = x * y;
} else if ((x * y) <= -4e-183) {
tmp = t_1;
} else if ((x * y) <= -1.05e-307) {
tmp = c;
} else if ((x * y) <= 2e-317) {
tmp = t_1;
} else if ((x * y) <= 4.5e-205) {
tmp = c;
} else if ((x * y) <= 2.5e+68) {
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 = a * (b * (-0.25d0))
if ((x * y) <= (-3d+26)) then
tmp = x * y
else if ((x * y) <= (-4d-183)) then
tmp = t_1
else if ((x * y) <= (-1.05d-307)) then
tmp = c
else if ((x * y) <= 2d-317) then
tmp = t_1
else if ((x * y) <= 4.5d-205) then
tmp = c
else if ((x * y) <= 2.5d+68) 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 = a * (b * -0.25);
double tmp;
if ((x * y) <= -3e+26) {
tmp = x * y;
} else if ((x * y) <= -4e-183) {
tmp = t_1;
} else if ((x * y) <= -1.05e-307) {
tmp = c;
} else if ((x * y) <= 2e-317) {
tmp = t_1;
} else if ((x * y) <= 4.5e-205) {
tmp = c;
} else if ((x * y) <= 2.5e+68) {
tmp = t_1;
} 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) <= -3e+26: tmp = x * y elif (x * y) <= -4e-183: tmp = t_1 elif (x * y) <= -1.05e-307: tmp = c elif (x * y) <= 2e-317: tmp = t_1 elif (x * y) <= 4.5e-205: tmp = c elif (x * y) <= 2.5e+68: tmp = t_1 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) <= -3e+26) tmp = Float64(x * y); elseif (Float64(x * y) <= -4e-183) tmp = t_1; elseif (Float64(x * y) <= -1.05e-307) tmp = c; elseif (Float64(x * y) <= 2e-317) tmp = t_1; elseif (Float64(x * y) <= 4.5e-205) tmp = c; elseif (Float64(x * y) <= 2.5e+68) 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 = a * (b * -0.25); tmp = 0.0; if ((x * y) <= -3e+26) tmp = x * y; elseif ((x * y) <= -4e-183) tmp = t_1; elseif ((x * y) <= -1.05e-307) tmp = c; elseif ((x * y) <= 2e-317) tmp = t_1; elseif ((x * y) <= 4.5e-205) tmp = c; elseif ((x * y) <= 2.5e+68) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3e+26], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-183], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-307], c, If[LessEqual[N[(x * y), $MachinePrecision], 2e-317], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.5e-205], c, If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+68], t$95$1, 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 \cdot 10^{+26}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-307}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-317}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{-205}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.99999999999999997e26 or 2.5000000000000002e68 < (*.f64 x y) Initial program 97.2%
Taylor expanded in z around 0 85.5%
fma-neg85.5%
distribute-lft-neg-in85.5%
metadata-eval85.5%
*-commutative85.5%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in x around inf 62.1%
if -2.99999999999999997e26 < (*.f64 x y) < -4.00000000000000002e-183 or -1.0500000000000001e-307 < (*.f64 x y) < 1.99999997e-317 or 4.49999999999999956e-205 < (*.f64 x y) < 2.5000000000000002e68Initial program 100.0%
Taylor expanded in z around 0 67.9%
fma-neg67.9%
distribute-lft-neg-in67.9%
metadata-eval67.9%
*-commutative67.9%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in a around inf 43.5%
*-commutative43.5%
associate-*r*43.5%
*-commutative43.5%
Simplified43.5%
if -4.00000000000000002e-183 < (*.f64 x y) < -1.0500000000000001e-307 or 1.99999997e-317 < (*.f64 x y) < 4.49999999999999956e-205Initial program 100.0%
Taylor expanded in c around inf 58.4%
Final simplification53.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<= (* x y) -1.3e+77)
(* x y)
(if (<= (* x y) -3.9e-290)
t_1
(if (<= (* x y) 2e-317)
(* a (* b -0.25))
(if (<= (* x y) 8.6e-172)
c
(if (<= (* x y) 1.6e+69) t_1 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.3e+77) {
tmp = x * y;
} else if ((x * y) <= -3.9e-290) {
tmp = t_1;
} else if ((x * y) <= 2e-317) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 8.6e-172) {
tmp = c;
} else if ((x * y) <= 1.6e+69) {
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 = z * (t * 0.0625d0)
if ((x * y) <= (-1.3d+77)) then
tmp = x * y
else if ((x * y) <= (-3.9d-290)) then
tmp = t_1
else if ((x * y) <= 2d-317) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 8.6d-172) then
tmp = c
else if ((x * y) <= 1.6d+69) 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 = z * (t * 0.0625);
double tmp;
if ((x * y) <= -1.3e+77) {
tmp = x * y;
} else if ((x * y) <= -3.9e-290) {
tmp = t_1;
} else if ((x * y) <= 2e-317) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 8.6e-172) {
tmp = c;
} else if ((x * y) <= 1.6e+69) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) tmp = 0 if (x * y) <= -1.3e+77: tmp = x * y elif (x * y) <= -3.9e-290: tmp = t_1 elif (x * y) <= 2e-317: tmp = a * (b * -0.25) elif (x * y) <= 8.6e-172: tmp = c elif (x * y) <= 1.6e+69: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(z * Float64(t * 0.0625)) tmp = 0.0 if (Float64(x * y) <= -1.3e+77) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.9e-290) tmp = t_1; elseif (Float64(x * y) <= 2e-317) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 8.6e-172) tmp = c; elseif (Float64(x * y) <= 1.6e+69) 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 = z * (t * 0.0625); tmp = 0.0; if ((x * y) <= -1.3e+77) tmp = x * y; elseif ((x * y) <= -3.9e-290) tmp = t_1; elseif ((x * y) <= 2e-317) tmp = a * (b * -0.25); elseif ((x * y) <= 8.6e-172) tmp = c; elseif ((x * y) <= 1.6e+69) 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[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.3e+77], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.9e-290], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-317], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.6e-172], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.6e+69], t$95$1, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+77}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.9 \cdot 10^{-290}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-317}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{-172}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.3000000000000001e77 or 1.59999999999999992e69 < (*.f64 x y) Initial program 97.9%
Taylor expanded in z around 0 89.8%
fma-neg89.8%
distribute-lft-neg-in89.8%
metadata-eval89.8%
*-commutative89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in x around inf 65.8%
if -1.3000000000000001e77 < (*.f64 x y) < -3.89999999999999973e-290 or 8.5999999999999995e-172 < (*.f64 x y) < 1.59999999999999992e69Initial program 99.0%
+-commutative99.0%
associate-/l*98.9%
associate-/r/99.0%
fma-define99.0%
div-inv99.0%
metadata-eval99.0%
Applied egg-rr99.0%
Taylor expanded in z around inf 64.0%
*-commutative64.0%
associate-*r*64.0%
*-commutative64.0%
associate-*l*64.0%
Simplified64.0%
Taylor expanded in z around inf 39.9%
associate-*r*39.9%
Simplified39.9%
if -3.89999999999999973e-290 < (*.f64 x y) < 1.99999997e-317Initial program 100.0%
Taylor expanded in z around 0 78.8%
fma-neg78.8%
distribute-lft-neg-in78.8%
metadata-eval78.8%
*-commutative78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in a around inf 59.2%
*-commutative59.2%
associate-*r*59.2%
*-commutative59.2%
Simplified59.2%
if 1.99999997e-317 < (*.f64 x y) < 8.5999999999999995e-172Initial program 100.0%
Taylor expanded in c around inf 53.1%
Final simplification53.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (- (* x y) (* (* b a) 0.25))))
(if (<= (* x y) -1.8e+74)
t_2
(if (<= (* x y) -6.5e-291)
t_1
(if (<= (* x y) 3e-92)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 1.25e+70) 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) - ((b * a) * 0.25);
double tmp;
if ((x * y) <= -1.8e+74) {
tmp = t_2;
} else if ((x * y) <= -6.5e-291) {
tmp = t_1;
} else if ((x * y) <= 3e-92) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1.25e+70) {
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) - ((b * a) * 0.25d0)
if ((x * y) <= (-1.8d+74)) then
tmp = t_2
else if ((x * y) <= (-6.5d-291)) then
tmp = t_1
else if ((x * y) <= 3d-92) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 1.25d+70) 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) - ((b * a) * 0.25);
double tmp;
if ((x * y) <= -1.8e+74) {
tmp = t_2;
} else if ((x * y) <= -6.5e-291) {
tmp = t_1;
} else if ((x * y) <= 3e-92) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 1.25e+70) {
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) - ((b * a) * 0.25) tmp = 0 if (x * y) <= -1.8e+74: tmp = t_2 elif (x * y) <= -6.5e-291: tmp = t_1 elif (x * y) <= 3e-92: tmp = c + (a * (b * -0.25)) elif (x * y) <= 1.25e+70: 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(b * a) * 0.25)) tmp = 0.0 if (Float64(x * y) <= -1.8e+74) tmp = t_2; elseif (Float64(x * y) <= -6.5e-291) tmp = t_1; elseif (Float64(x * y) <= 3e-92) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 1.25e+70) 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) - ((b * a) * 0.25); tmp = 0.0; if ((x * y) <= -1.8e+74) tmp = t_2; elseif ((x * y) <= -6.5e-291) tmp = t_1; elseif ((x * y) <= 3e-92) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 1.25e+70) 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[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+74], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -6.5e-291], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3e-92], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.25e+70], 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(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+74}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -6.5 \cdot 10^{-291}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-92}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.79999999999999994e74 or 1.2500000000000001e70 < (*.f64 x y) Initial program 97.9%
Taylor expanded in z around 0 89.7%
Taylor expanded in c around 0 81.9%
if -1.79999999999999994e74 < (*.f64 x y) < -6.50000000000000002e-291 or 3.00000000000000013e-92 < (*.f64 x y) < 1.2500000000000001e70Initial program 98.9%
Taylor expanded in z around inf 67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*67.1%
Simplified67.1%
if -6.50000000000000002e-291 < (*.f64 x y) < 3.00000000000000013e-92Initial program 100.0%
Taylor expanded in a around inf 74.1%
*-commutative74.1%
associate-*l*74.1%
Simplified74.1%
Final simplification74.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* t (* z 0.0625)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -3.9e+149)
t_2
(if (<= (* x y) -1.5e-289)
t_1
(if (<= (* x y) 3.2e-93)
(+ c (* a (* b -0.25)))
(if (<= (* x y) 2.15e+69) 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 = c + (x * y);
double tmp;
if ((x * y) <= -3.9e+149) {
tmp = t_2;
} else if ((x * y) <= -1.5e-289) {
tmp = t_1;
} else if ((x * y) <= 3.2e-93) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 2.15e+69) {
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 = c + (x * y)
if ((x * y) <= (-3.9d+149)) then
tmp = t_2
else if ((x * y) <= (-1.5d-289)) then
tmp = t_1
else if ((x * y) <= 3.2d-93) then
tmp = c + (a * (b * (-0.25d0)))
else if ((x * y) <= 2.15d+69) 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 = c + (x * y);
double tmp;
if ((x * y) <= -3.9e+149) {
tmp = t_2;
} else if ((x * y) <= -1.5e-289) {
tmp = t_1;
} else if ((x * y) <= 3.2e-93) {
tmp = c + (a * (b * -0.25));
} else if ((x * y) <= 2.15e+69) {
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 = c + (x * y) tmp = 0 if (x * y) <= -3.9e+149: tmp = t_2 elif (x * y) <= -1.5e-289: tmp = t_1 elif (x * y) <= 3.2e-93: tmp = c + (a * (b * -0.25)) elif (x * y) <= 2.15e+69: 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(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.9e+149) tmp = t_2; elseif (Float64(x * y) <= -1.5e-289) tmp = t_1; elseif (Float64(x * y) <= 3.2e-93) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(x * y) <= 2.15e+69) 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 = c + (x * y); tmp = 0.0; if ((x * y) <= -3.9e+149) tmp = t_2; elseif ((x * y) <= -1.5e-289) tmp = t_1; elseif ((x * y) <= 3.2e-93) tmp = c + (a * (b * -0.25)); elseif ((x * y) <= 2.15e+69) 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[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.9e+149], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.5e-289], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-93], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.15e+69], 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 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -3.9 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-93}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.8999999999999999e149 or 2.14999999999999996e69 < (*.f64 x y) Initial program 97.6%
Taylor expanded in x around inf 78.0%
if -3.8999999999999999e149 < (*.f64 x y) < -1.4999999999999999e-289 or 3.1999999999999999e-93 < (*.f64 x y) < 2.14999999999999996e69Initial program 99.0%
Taylor expanded in z around inf 65.0%
associate-*r*65.0%
*-commutative65.0%
associate-*r*65.0%
Simplified65.0%
if -1.4999999999999999e-289 < (*.f64 x y) < 3.1999999999999999e-93Initial program 100.0%
Taylor expanded in a around inf 74.1%
*-commutative74.1%
associate-*l*74.1%
Simplified74.1%
Final simplification71.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))) (t_2 (* (* b a) 0.25)))
(if (<= (* x y) -2.8e+26)
(+ c (+ (* x y) t_1))
(if (<= (* x y) 7.2e+68) (- (+ c t_1) t_2) (- (+ c (* x y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (b * a) * 0.25;
double tmp;
if ((x * y) <= -2.8e+26) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 7.2e+68) {
tmp = (c + t_1) - t_2;
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.0625d0 * (z * t)
t_2 = (b * a) * 0.25d0
if ((x * y) <= (-2.8d+26)) then
tmp = c + ((x * y) + t_1)
else if ((x * y) <= 7.2d+68) then
tmp = (c + t_1) - t_2
else
tmp = (c + (x * y)) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double t_2 = (b * a) * 0.25;
double tmp;
if ((x * y) <= -2.8e+26) {
tmp = c + ((x * y) + t_1);
} else if ((x * y) <= 7.2e+68) {
tmp = (c + t_1) - t_2;
} else {
tmp = (c + (x * y)) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) t_2 = (b * a) * 0.25 tmp = 0 if (x * y) <= -2.8e+26: tmp = c + ((x * y) + t_1) elif (x * y) <= 7.2e+68: tmp = (c + t_1) - t_2 else: tmp = (c + (x * y)) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.0625 * Float64(z * t)) t_2 = Float64(Float64(b * a) * 0.25) tmp = 0.0 if (Float64(x * y) <= -2.8e+26) tmp = Float64(c + Float64(Float64(x * y) + t_1)); elseif (Float64(x * y) <= 7.2e+68) tmp = Float64(Float64(c + t_1) - t_2); else tmp = Float64(Float64(c + Float64(x * y)) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.0625 * (z * t); t_2 = (b * a) * 0.25; tmp = 0.0; if ((x * y) <= -2.8e+26) tmp = c + ((x * y) + t_1); elseif ((x * y) <= 7.2e+68) tmp = (c + t_1) - t_2; else tmp = (c + (x * y)) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e+26], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.2e+68], N[(N[(c + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
t_2 := \left(b \cdot a\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -2.8 \cdot 10^{+26}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 7.2 \cdot 10^{+68}:\\
\;\;\;\;\left(c + t\_1\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.8e26Initial program 98.3%
Taylor expanded in a around 0 90.2%
if -2.8e26 < (*.f64 x y) < 7.1999999999999998e68Initial program 100.0%
Taylor expanded in x around 0 95.6%
if 7.1999999999999998e68 < (*.f64 x y) Initial program 95.9%
Taylor expanded in z around 0 90.1%
Final simplification93.3%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+93) (not (<= (* b a) 1e+149))) (- (* x y) (* (* b a) 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 (((b * a) <= -5e+93) || !((b * a) <= 1e+149)) {
tmp = (x * y) - ((b * a) * 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 (((b * a) <= (-5d+93)) .or. (.not. ((b * a) <= 1d+149))) then
tmp = (x * y) - ((b * a) * 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 (((b * a) <= -5e+93) || !((b * a) <= 1e+149)) {
tmp = (x * y) - ((b * a) * 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 ((b * a) <= -5e+93) or not ((b * a) <= 1e+149): tmp = (x * y) - ((b * a) * 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(b * a) <= -5e+93) || !(Float64(b * a) <= 1e+149)) tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 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 (((b * a) <= -5e+93) || ~(((b * a) <= 1e+149))) tmp = (x * y) - ((b * a) * 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[(b * a), $MachinePrecision], -5e+93], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1e+149]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $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}\;b \cdot a \leq -5 \cdot 10^{+93} \lor \neg \left(b \cdot a \leq 10^{+149}\right):\\
\;\;\;\;x \cdot y - \left(b \cdot a\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.0000000000000001e93 or 1.00000000000000005e149 < (*.f64 a b) Initial program 96.2%
Taylor expanded in z around 0 89.4%
Taylor expanded in c around 0 84.5%
if -5.0000000000000001e93 < (*.f64 a b) < 1.00000000000000005e149Initial program 100.0%
Taylor expanded in a around 0 91.0%
Final simplification89.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* b a) -5e+93) (not (<= (* b a) 1e-44))) (- (+ c (* x y)) (* (* b a) 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 (((b * a) <= -5e+93) || !((b * a) <= 1e-44)) {
tmp = (c + (x * y)) - ((b * a) * 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 (((b * a) <= (-5d+93)) .or. (.not. ((b * a) <= 1d-44))) then
tmp = (c + (x * y)) - ((b * a) * 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 (((b * a) <= -5e+93) || !((b * a) <= 1e-44)) {
tmp = (c + (x * y)) - ((b * a) * 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 ((b * a) <= -5e+93) or not ((b * a) <= 1e-44): tmp = (c + (x * y)) - ((b * a) * 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(b * a) <= -5e+93) || !(Float64(b * a) <= 1e-44)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(b * a) * 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 (((b * a) <= -5e+93) || ~(((b * a) <= 1e-44))) tmp = (c + (x * y)) - ((b * a) * 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[(b * a), $MachinePrecision], -5e+93], N[Not[LessEqual[N[(b * a), $MachinePrecision], 1e-44]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $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}\;b \cdot a \leq -5 \cdot 10^{+93} \lor \neg \left(b \cdot a \leq 10^{-44}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\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.0000000000000001e93 or 9.99999999999999953e-45 < (*.f64 a b) Initial program 97.2%
Taylor expanded in z around 0 87.8%
if -5.0000000000000001e93 < (*.f64 a b) < 9.99999999999999953e-45Initial program 100.0%
Taylor expanded in a around 0 96.1%
Final simplification92.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -6.6e+26) (not (<= (* x y) 1.25e+68))) (+ c (* x y)) (+ c (* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -6.6e+26) || !((x * y) <= 1.25e+68)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((x * y) <= (-6.6d+26)) .or. (.not. ((x * y) <= 1.25d+68))) then
tmp = c + (x * y)
else
tmp = c + (a * (b * (-0.25d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -6.6e+26) || !((x * y) <= 1.25e+68)) {
tmp = c + (x * y);
} else {
tmp = c + (a * (b * -0.25));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -6.6e+26) or not ((x * y) <= 1.25e+68): tmp = c + (x * y) else: tmp = c + (a * (b * -0.25)) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -6.6e+26) || !(Float64(x * y) <= 1.25e+68)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(a * Float64(b * -0.25))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((x * y) <= -6.6e+26) || ~(((x * y) <= 1.25e+68))) tmp = c + (x * y); else tmp = c + (a * (b * -0.25)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -6.6e+26], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+68]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.6 \cdot 10^{+26} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+68}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -6.59999999999999987e26 or 1.2500000000000001e68 < (*.f64 x y) Initial program 97.2%
Taylor expanded in x around inf 71.6%
if -6.59999999999999987e26 < (*.f64 x y) < 1.2500000000000001e68Initial program 100.0%
Taylor expanded in a around inf 63.6%
*-commutative63.6%
associate-*l*63.6%
Simplified63.6%
Final simplification67.0%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -7000000000.0) (not (<= (* x y) 2.05e+71))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -7000000000.0) || !((x * y) <= 2.05e+71)) {
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) <= (-7000000000.0d0)) .or. (.not. ((x * y) <= 2.05d+71))) 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) <= -7000000000.0) || !((x * y) <= 2.05e+71)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -7000000000.0) or not ((x * y) <= 2.05e+71): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -7000000000.0) || !(Float64(x * y) <= 2.05e+71)) 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) <= -7000000000.0) || ~(((x * y) <= 2.05e+71))) 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], -7000000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.05e+71]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7000000000 \lor \neg \left(x \cdot y \leq 2.05 \cdot 10^{+71}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -7e9 or 2.0500000000000001e71 < (*.f64 x y) Initial program 97.2%
Taylor expanded in z around 0 86.2%
fma-neg86.3%
distribute-lft-neg-in86.3%
metadata-eval86.3%
*-commutative86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in x around inf 62.6%
if -7e9 < (*.f64 x y) < 2.0500000000000001e71Initial program 100.0%
Taylor expanded in c around inf 28.7%
Final simplification43.0%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* b a) 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)) - ((b * a) / 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)) - ((b * a) / 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)) - ((b * a) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((b * a) / 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(b * a) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((b * a) / 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[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{b \cdot a}{4}\right)
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= a -4.5e+164) (not (<= a 2e+33))) (* a (* b -0.25)) (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -4.5e+164) || !(a <= 2e+33)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a <= (-4.5d+164)) .or. (.not. (a <= 2d+33))) then
tmp = a * (b * (-0.25d0))
else
tmp = c + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -4.5e+164) || !(a <= 2e+33)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -4.5e+164) or not (a <= 2e+33): tmp = a * (b * -0.25) else: tmp = c + (x * y) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -4.5e+164) || !(a <= 2e+33)) tmp = Float64(a * Float64(b * -0.25)); else tmp = Float64(c + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((a <= -4.5e+164) || ~((a <= 2e+33))) tmp = a * (b * -0.25); else tmp = c + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -4.5e+164], N[Not[LessEqual[a, 2e+33]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+164} \lor \neg \left(a \leq 2 \cdot 10^{+33}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -4.49999999999999975e164 or 1.9999999999999999e33 < a Initial program 96.4%
Taylor expanded in z around 0 78.7%
fma-neg78.7%
distribute-lft-neg-in78.7%
metadata-eval78.7%
*-commutative78.7%
associate-*l*78.7%
Simplified78.7%
Taylor expanded in a around inf 50.1%
*-commutative50.1%
associate-*r*50.1%
*-commutative50.1%
Simplified50.1%
if -4.49999999999999975e164 < a < 1.9999999999999999e33Initial program 100.0%
Taylor expanded in x around inf 57.1%
Final simplification54.8%
(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.8%
Taylor expanded in c around inf 21.1%
Final simplification21.1%
herbie shell --seed 2024034
(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))