
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 96.9%
associate--l+96.9%
fma-define98.4%
associate-/l*98.4%
fma-neg98.4%
distribute-neg-frac298.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
function code(x, y, z, t, a, b, c) return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-+l-96.9%
fma-define98.0%
*-commutative98.0%
associate-/l*98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25))))
(t_2 (+ c (* 0.0625 (* z t))))
(t_3 (+ c (* x y))))
(if (<= (* x y) -1.6e+100)
t_3
(if (<= (* x y) -7.2e-23)
t_1
(if (<= (* x y) -1.4e-117)
t_2
(if (<= (* x y) 8.2e-159) t_1 (if (<= (* x y) 3.1e+89) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = c + (0.0625 * (z * t));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1.6e+100) {
tmp = t_3;
} else if ((x * y) <= -7.2e-23) {
tmp = t_1;
} else if ((x * y) <= -1.4e-117) {
tmp = t_2;
} else if ((x * y) <= 8.2e-159) {
tmp = t_1;
} else if ((x * y) <= 3.1e+89) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (b * (a * (-0.25d0)))
t_2 = c + (0.0625d0 * (z * t))
t_3 = c + (x * y)
if ((x * y) <= (-1.6d+100)) then
tmp = t_3
else if ((x * y) <= (-7.2d-23)) then
tmp = t_1
else if ((x * y) <= (-1.4d-117)) then
tmp = t_2
else if ((x * y) <= 8.2d-159) then
tmp = t_1
else if ((x * y) <= 3.1d+89) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (b * (a * -0.25));
double t_2 = c + (0.0625 * (z * t));
double t_3 = c + (x * y);
double tmp;
if ((x * y) <= -1.6e+100) {
tmp = t_3;
} else if ((x * y) <= -7.2e-23) {
tmp = t_1;
} else if ((x * y) <= -1.4e-117) {
tmp = t_2;
} else if ((x * y) <= 8.2e-159) {
tmp = t_1;
} else if ((x * y) <= 3.1e+89) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (b * (a * -0.25)) t_2 = c + (0.0625 * (z * t)) t_3 = c + (x * y) tmp = 0 if (x * y) <= -1.6e+100: tmp = t_3 elif (x * y) <= -7.2e-23: tmp = t_1 elif (x * y) <= -1.4e-117: tmp = t_2 elif (x * y) <= 8.2e-159: tmp = t_1 elif (x * y) <= 3.1e+89: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(b * Float64(a * -0.25))) t_2 = Float64(c + Float64(0.0625 * Float64(z * t))) t_3 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.6e+100) tmp = t_3; elseif (Float64(x * y) <= -7.2e-23) tmp = t_1; elseif (Float64(x * y) <= -1.4e-117) tmp = t_2; elseif (Float64(x * y) <= 8.2e-159) tmp = t_1; elseif (Float64(x * y) <= 3.1e+89) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (b * (a * -0.25)); t_2 = c + (0.0625 * (z * t)); t_3 = c + (x * y); tmp = 0.0; if ((x * y) <= -1.6e+100) tmp = t_3; elseif ((x * y) <= -7.2e-23) tmp = t_1; elseif ((x * y) <= -1.4e-117) tmp = t_2; elseif ((x * y) <= 8.2e-159) tmp = t_1; elseif ((x * y) <= 3.1e+89) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+100], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -7.2e-23], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.4e-117], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e-159], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e+89], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
t_2 := c + 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.6 \cdot 10^{+100}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -7.2 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.4 \cdot 10^{-117}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+89}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.5999999999999999e100 or 3.1e89 < (*.f64 x y) Initial program 90.8%
Taylor expanded in a around 0 86.4%
Taylor expanded in t around 0 78.7%
+-commutative78.7%
Simplified78.7%
if -1.5999999999999999e100 < (*.f64 x y) < -7.1999999999999996e-23 or -1.4e-117 < (*.f64 x y) < 8.20000000000000029e-159Initial program 100.0%
Taylor expanded in a around inf 71.8%
associate-*r*71.8%
*-commutative71.8%
*-commutative71.8%
Simplified71.8%
if -7.1999999999999996e-23 < (*.f64 x y) < -1.4e-117 or 8.20000000000000029e-159 < (*.f64 x y) < 3.1e89Initial program 100.0%
Taylor expanded in a around 0 78.7%
Taylor expanded in x around 0 74.0%
Final simplification74.7%
(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 (* z (+ (* t 0.0625) (/ (* x y) z)))))))
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 + (z * ((t * 0.0625) + ((x * y) / z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (z * ((t * 0.0625) + ((x * y) / z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (z * ((t * 0.0625) + ((x * y) / z))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(z * Float64(Float64(t * 0.0625) + Float64(Float64(x * y) / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0); tmp = 0.0; if (t_1 <= Inf) tmp = c + t_1; else tmp = c + (z * ((t * 0.0625) + ((x * y) / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $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 + z \cdot \left(t \cdot 0.0625 + \frac{x \cdot y}{z}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in z around inf 25.0%
Taylor expanded in a around 0 50.0%
Final simplification98.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* z (* t 0.0625))))
(if (<= y -1.5e-80)
(* x y)
(if (<= y -1.65e-170)
t_1
(if (<= y 1.8e-190)
c
(if (<= y 9e-80)
t_1
(if (<= y 1.7e-59)
c
(if (<= y 3.9e+149) (* a (* b -0.25)) (* 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 (y <= -1.5e-80) {
tmp = x * y;
} else if (y <= -1.65e-170) {
tmp = t_1;
} else if (y <= 1.8e-190) {
tmp = c;
} else if (y <= 9e-80) {
tmp = t_1;
} else if (y <= 1.7e-59) {
tmp = c;
} else if (y <= 3.9e+149) {
tmp = a * (b * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = z * (t * 0.0625d0)
if (y <= (-1.5d-80)) then
tmp = x * y
else if (y <= (-1.65d-170)) then
tmp = t_1
else if (y <= 1.8d-190) then
tmp = c
else if (y <= 9d-80) then
tmp = t_1
else if (y <= 1.7d-59) then
tmp = c
else if (y <= 3.9d+149) then
tmp = a * (b * (-0.25d0))
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = z * (t * 0.0625);
double tmp;
if (y <= -1.5e-80) {
tmp = x * y;
} else if (y <= -1.65e-170) {
tmp = t_1;
} else if (y <= 1.8e-190) {
tmp = c;
} else if (y <= 9e-80) {
tmp = t_1;
} else if (y <= 1.7e-59) {
tmp = c;
} else if (y <= 3.9e+149) {
tmp = a * (b * -0.25);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = z * (t * 0.0625) tmp = 0 if y <= -1.5e-80: tmp = x * y elif y <= -1.65e-170: tmp = t_1 elif y <= 1.8e-190: tmp = c elif y <= 9e-80: tmp = t_1 elif y <= 1.7e-59: tmp = c elif y <= 3.9e+149: tmp = a * (b * -0.25) 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 (y <= -1.5e-80) tmp = Float64(x * y); elseif (y <= -1.65e-170) tmp = t_1; elseif (y <= 1.8e-190) tmp = c; elseif (y <= 9e-80) tmp = t_1; elseif (y <= 1.7e-59) tmp = c; elseif (y <= 3.9e+149) tmp = Float64(a * Float64(b * -0.25)); 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 (y <= -1.5e-80) tmp = x * y; elseif (y <= -1.65e-170) tmp = t_1; elseif (y <= 1.8e-190) tmp = c; elseif (y <= 9e-80) tmp = t_1; elseif (y <= 1.7e-59) tmp = c; elseif (y <= 3.9e+149) tmp = a * (b * -0.25); 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[y, -1.5e-80], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.65e-170], t$95$1, If[LessEqual[y, 1.8e-190], c, If[LessEqual[y, 9e-80], t$95$1, If[LessEqual[y, 1.7e-59], c, If[LessEqual[y, 3.9e+149], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-80}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-190}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-59}:\\
\;\;\;\;c\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+149}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.50000000000000004e-80 or 3.8999999999999999e149 < y Initial program 93.3%
Taylor expanded in z around inf 81.1%
Taylor expanded in a around 0 67.7%
Taylor expanded in x around inf 45.8%
if -1.50000000000000004e-80 < y < -1.65000000000000002e-170 or 1.80000000000000003e-190 < y < 9.0000000000000006e-80Initial program 100.0%
Taylor expanded in z around inf 93.0%
Taylor expanded in t around inf 36.8%
if -1.65000000000000002e-170 < y < 1.80000000000000003e-190 or 9.0000000000000006e-80 < y < 1.70000000000000009e-59Initial program 100.0%
Taylor expanded in c around inf 39.5%
if 1.70000000000000009e-59 < y < 3.8999999999999999e149Initial program 100.0%
Taylor expanded in x around 0 79.7%
Taylor expanded in t around 0 49.2%
Taylor expanded in c around 0 35.9%
associate-*r*35.9%
*-commutative35.9%
associate-*r*35.9%
Simplified35.9%
Final simplification41.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -1.4e+63)
(* x y)
(if (<= (* x y) 9.2e-253)
t_1
(if (<= (* x y) 4.2e-85) c (if (<= (* x y) 4.8e-5) 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) <= -1.4e+63) {
tmp = x * y;
} else if ((x * y) <= 9.2e-253) {
tmp = t_1;
} else if ((x * y) <= 4.2e-85) {
tmp = c;
} else if ((x * y) <= 4.8e-5) {
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) <= (-1.4d+63)) then
tmp = x * y
else if ((x * y) <= 9.2d-253) then
tmp = t_1
else if ((x * y) <= 4.2d-85) then
tmp = c
else if ((x * y) <= 4.8d-5) 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) <= -1.4e+63) {
tmp = x * y;
} else if ((x * y) <= 9.2e-253) {
tmp = t_1;
} else if ((x * y) <= 4.2e-85) {
tmp = c;
} else if ((x * y) <= 4.8e-5) {
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) <= -1.4e+63: tmp = x * y elif (x * y) <= 9.2e-253: tmp = t_1 elif (x * y) <= 4.2e-85: tmp = c elif (x * y) <= 4.8e-5: 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) <= -1.4e+63) tmp = Float64(x * y); elseif (Float64(x * y) <= 9.2e-253) tmp = t_1; elseif (Float64(x * y) <= 4.2e-85) tmp = c; elseif (Float64(x * y) <= 4.8e-5) 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) <= -1.4e+63) tmp = x * y; elseif ((x * y) <= 9.2e-253) tmp = t_1; elseif ((x * y) <= 4.2e-85) tmp = c; elseif ((x * y) <= 4.8e-5) 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], -1.4e+63], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.2e-253], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.2e-85], c, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-5], 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 -1.4 \cdot 10^{+63}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{-253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{-85}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.39999999999999993e63 or 4.8000000000000001e-5 < (*.f64 x y) Initial program 92.8%
Taylor expanded in z around inf 76.2%
Taylor expanded in a around 0 69.3%
Taylor expanded in x around inf 62.1%
if -1.39999999999999993e63 < (*.f64 x y) < 9.2000000000000001e-253 or 4.2e-85 < (*.f64 x y) < 4.8000000000000001e-5Initial program 100.0%
Taylor expanded in x around 0 98.4%
Taylor expanded in t around 0 67.8%
Taylor expanded in c around 0 42.9%
associate-*r*42.9%
*-commutative42.9%
associate-*r*42.9%
Simplified42.9%
if 9.2000000000000001e-253 < (*.f64 x y) < 4.2e-85Initial program 100.0%
Taylor expanded in c around inf 49.4%
Final simplification52.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y))))
(if (<= (* x y) -6.6e+62)
t_1
(if (<= (* x y) -6e-20)
(* a (* b -0.25))
(if (<= (* x y) 1.15e+93) (+ 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) <= -6.6e+62) {
tmp = t_1;
} else if ((x * y) <= -6e-20) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 1.15e+93) {
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) <= (-6.6d+62)) then
tmp = t_1
else if ((x * y) <= (-6d-20)) then
tmp = a * (b * (-0.25d0))
else if ((x * y) <= 1.15d+93) 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) <= -6.6e+62) {
tmp = t_1;
} else if ((x * y) <= -6e-20) {
tmp = a * (b * -0.25);
} else if ((x * y) <= 1.15e+93) {
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) <= -6.6e+62: tmp = t_1 elif (x * y) <= -6e-20: tmp = a * (b * -0.25) elif (x * y) <= 1.15e+93: 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) <= -6.6e+62) tmp = t_1; elseif (Float64(x * y) <= -6e-20) tmp = Float64(a * Float64(b * -0.25)); elseif (Float64(x * y) <= 1.15e+93) 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) <= -6.6e+62) tmp = t_1; elseif ((x * y) <= -6e-20) tmp = a * (b * -0.25); elseif ((x * y) <= 1.15e+93) 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], -6.6e+62], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -6e-20], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e+93], 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 -6.6 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{+93}:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -6.6e62 or 1.1500000000000001e93 < (*.f64 x y) Initial program 91.5%
Taylor expanded in a around 0 84.3%
Taylor expanded in t around 0 76.1%
+-commutative76.1%
Simplified76.1%
if -6.6e62 < (*.f64 x y) < -6.00000000000000057e-20Initial program 99.8%
Taylor expanded in x around 0 95.4%
Taylor expanded in t around 0 74.7%
Taylor expanded in c around 0 66.8%
associate-*r*66.8%
*-commutative66.8%
associate-*r*66.8%
Simplified66.8%
if -6.00000000000000057e-20 < (*.f64 x y) < 1.1500000000000001e93Initial program 100.0%
Taylor expanded in a around 0 69.3%
Taylor expanded in x around 0 66.4%
Final simplification70.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
(if (<= (* x y) -7.8e+62)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 2.7e+87) (- (+ c t_2) t_1) (+ c (+ (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -7.8e+62) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 2.7e+87) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
if ((x * y) <= (-7.8d+62)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 2.7d+87) then
tmp = (c + t_2) - t_1
else
tmp = c + ((x * y) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double tmp;
if ((x * y) <= -7.8e+62) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 2.7e+87) {
tmp = (c + t_2) - t_1;
} else {
tmp = c + ((x * y) + t_2);
}
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 (x * y) <= -7.8e+62: tmp = (c + (x * y)) - t_1 elif (x * y) <= 2.7e+87: tmp = (c + t_2) - t_1 else: tmp = c + ((x * y) + t_2) 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(x * y) <= -7.8e+62) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 2.7e+87) tmp = Float64(Float64(c + t_2) - t_1); else tmp = Float64(c + Float64(Float64(x * y) + t_2)); 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 ((x * y) <= -7.8e+62) tmp = (c + (x * y)) - t_1; elseif ((x * y) <= 2.7e+87) tmp = (c + t_2) - t_1; else tmp = c + ((x * y) + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.8e+62], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.7e+87], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $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}\;x \cdot y \leq -7.8 \cdot 10^{+62}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{+87}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -7.8e62Initial program 95.6%
Taylor expanded in z around 0 82.7%
if -7.8e62 < (*.f64 x y) < 2.70000000000000007e87Initial program 100.0%
Taylor expanded in x around 0 97.1%
if 2.70000000000000007e87 < (*.f64 x y) Initial program 88.0%
Taylor expanded in a around 0 88.1%
Final simplification92.8%
(FPCore (x y z t a b c)
:precision binary64
(if (or (<= a -8.5e+216)
(not
(or (<= a -3.1e+123) (and (not (<= a -3.7e+63)) (<= a 2.6e+28)))))
(* 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 <= -8.5e+216) || !((a <= -3.1e+123) || (!(a <= -3.7e+63) && (a <= 2.6e+28)))) {
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 <= (-8.5d+216)) .or. (.not. (a <= (-3.1d+123)) .or. (.not. (a <= (-3.7d+63))) .and. (a <= 2.6d+28))) 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 <= -8.5e+216) || !((a <= -3.1e+123) || (!(a <= -3.7e+63) && (a <= 2.6e+28)))) {
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 <= -8.5e+216) or not ((a <= -3.1e+123) or (not (a <= -3.7e+63) and (a <= 2.6e+28))): 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 <= -8.5e+216) || !((a <= -3.1e+123) || (!(a <= -3.7e+63) && (a <= 2.6e+28)))) 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 <= -8.5e+216) || ~(((a <= -3.1e+123) || (~((a <= -3.7e+63)) && (a <= 2.6e+28))))) 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, -8.5e+216], N[Not[Or[LessEqual[a, -3.1e+123], And[N[Not[LessEqual[a, -3.7e+63]], $MachinePrecision], LessEqual[a, 2.6e+28]]]], $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 -8.5 \cdot 10^{+216} \lor \neg \left(a \leq -3.1 \cdot 10^{+123} \lor \neg \left(a \leq -3.7 \cdot 10^{+63}\right) \land a \leq 2.6 \cdot 10^{+28}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -8.4999999999999997e216 or -3.10000000000000006e123 < a < -3.69999999999999968e63 or 2.6000000000000002e28 < a Initial program 95.9%
Taylor expanded in x around 0 82.0%
Taylor expanded in t around 0 60.7%
Taylor expanded in c around 0 48.6%
associate-*r*48.6%
*-commutative48.6%
associate-*r*48.6%
Simplified48.6%
if -8.4999999999999997e216 < a < -3.10000000000000006e123 or -3.69999999999999968e63 < a < 2.6000000000000002e28Initial program 97.5%
Taylor expanded in a around 0 84.7%
Taylor expanded in t around 0 58.2%
+-commutative58.2%
Simplified58.2%
Final simplification54.6%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -20000000.0) (not (<= (* a b) 2e+90))) (- (+ c (* x y)) (* (* a b) 0.25)) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -20000000.0) || !((a * b) <= 2e+90)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-20000000.0d0)) .or. (.not. ((a * b) <= 2d+90))) then
tmp = (c + (x * y)) - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -20000000.0) || !((a * b) <= 2e+90)) {
tmp = (c + (x * y)) - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -20000000.0) or not ((a * b) <= 2e+90): tmp = (c + (x * y)) - ((a * b) * 0.25) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -20000000.0) || !(Float64(a * b) <= 2e+90)) tmp = Float64(Float64(c + Float64(x * y)) - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -20000000.0) || ~(((a * b) <= 2e+90))) tmp = (c + (x * y)) - ((a * b) * 0.25); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+90]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -20000000 \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+90}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2e7 or 1.99999999999999993e90 < (*.f64 a b) Initial program 95.7%
Taylor expanded in z around 0 83.4%
if -2e7 < (*.f64 a b) < 1.99999999999999993e90Initial program 97.8%
Taylor expanded in a around 0 94.3%
Final simplification89.3%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -2e+80)
(+ c (* b (* a -0.25)))
(if (<= (* a b) 1e+253)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(* a (* b -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+80) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+253) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((a * b) <= (-2d+80)) then
tmp = c + (b * (a * (-0.25d0)))
else if ((a * b) <= 1d+253) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = a * (b * (-0.25d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a * b) <= -2e+80) {
tmp = c + (b * (a * -0.25));
} else if ((a * b) <= 1e+253) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = a * (b * -0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -2e+80: tmp = c + (b * (a * -0.25)) elif (a * b) <= 1e+253: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = a * (b * -0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -2e+80) tmp = Float64(c + Float64(b * Float64(a * -0.25))); elseif (Float64(a * b) <= 1e+253) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = 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 ((a * b) <= -2e+80) tmp = c + (b * (a * -0.25)); elseif ((a * b) <= 1e+253) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = a * (b * -0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -2e+80], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+253], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+80}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+253}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2e80Initial program 97.5%
Taylor expanded in a around inf 83.9%
associate-*r*83.9%
*-commutative83.9%
*-commutative83.9%
Simplified83.9%
if -2e80 < (*.f64 a b) < 9.9999999999999994e252Initial program 97.8%
Taylor expanded in a around 0 89.0%
if 9.9999999999999994e252 < (*.f64 a b) Initial program 89.3%
Taylor expanded in x around 0 86.0%
Taylor expanded in t around 0 79.3%
Taylor expanded in c around 0 79.3%
associate-*r*79.3%
*-commutative79.3%
associate-*r*79.3%
Simplified79.3%
Final simplification87.1%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -4e+40) (not (<= (* x y) 8.8e+95))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -4e+40) || !((x * y) <= 8.8e+95)) {
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) <= (-4d+40)) .or. (.not. ((x * y) <= 8.8d+95))) 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) <= -4e+40) || !((x * y) <= 8.8e+95)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -4e+40) or not ((x * y) <= 8.8e+95): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -4e+40) || !(Float64(x * y) <= 8.8e+95)) 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) <= -4e+40) || ~(((x * y) <= 8.8e+95))) 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], -4e+40], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8.8e+95]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+40} \lor \neg \left(x \cdot y \leq 8.8 \cdot 10^{+95}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -4.00000000000000012e40 or 8.7999999999999996e95 < (*.f64 x y) Initial program 92.0%
Taylor expanded in z around inf 73.3%
Taylor expanded in a around 0 65.6%
Taylor expanded in x around inf 66.4%
if -4.00000000000000012e40 < (*.f64 x y) < 8.7999999999999996e95Initial program 100.0%
Taylor expanded in c around inf 32.1%
Final simplification45.5%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 96.9%
Taylor expanded in c around inf 22.1%
Final simplification22.1%
herbie shell --seed 2024077
(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))