
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
function code(x, y, z, t, a, b, c) return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c) end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 97.7%
associate--l+97.7%
fma-define98.5%
associate-/l*98.5%
fma-neg98.5%
distribute-neg-frac298.5%
metadata-eval98.5%
Simplified98.5%
(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 97.7%
associate-+l-97.7%
*-commutative97.7%
associate-+l-97.7%
fma-define97.7%
*-commutative97.7%
associate-/l*97.7%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
(if (<= (* x y) -2.1e+72)
t_2
(if (<= (* x y) 1.35e-110)
t_1
(if (<= (* x y) 13500.0)
(+ c (* 0.0625 (* z t)))
(if (<= (* x y) 8e+17) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -2.1e+72) {
tmp = t_2;
} else if ((x * y) <= 1.35e-110) {
tmp = t_1;
} else if ((x * y) <= 13500.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 8e+17) {
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 + (a * (b * (-0.25d0)))
t_2 = c + (x * y)
if ((x * y) <= (-2.1d+72)) then
tmp = t_2
else if ((x * y) <= 1.35d-110) then
tmp = t_1
else if ((x * y) <= 13500.0d0) then
tmp = c + (0.0625d0 * (z * t))
else if ((x * y) <= 8d+17) 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 + (a * (b * -0.25));
double t_2 = c + (x * y);
double tmp;
if ((x * y) <= -2.1e+72) {
tmp = t_2;
} else if ((x * y) <= 1.35e-110) {
tmp = t_1;
} else if ((x * y) <= 13500.0) {
tmp = c + (0.0625 * (z * t));
} else if ((x * y) <= 8e+17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (a * (b * -0.25)) t_2 = c + (x * y) tmp = 0 if (x * y) <= -2.1e+72: tmp = t_2 elif (x * y) <= 1.35e-110: tmp = t_1 elif (x * y) <= 13500.0: tmp = c + (0.0625 * (z * t)) elif (x * y) <= 8e+17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(a * Float64(b * -0.25))) t_2 = Float64(c + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.1e+72) tmp = t_2; elseif (Float64(x * y) <= 1.35e-110) tmp = t_1; elseif (Float64(x * y) <= 13500.0) tmp = Float64(c + Float64(0.0625 * Float64(z * t))); elseif (Float64(x * y) <= 8e+17) 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 + (a * (b * -0.25)); t_2 = c + (x * y); tmp = 0.0; if ((x * y) <= -2.1e+72) tmp = t_2; elseif ((x * y) <= 1.35e-110) tmp = t_1; elseif ((x * y) <= 13500.0) tmp = c + (0.0625 * (z * t)); elseif ((x * y) <= 8e+17) 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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+72], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.35e-110], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 13500.0], N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8e+17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + a \cdot \left(b \cdot -0.25\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.35 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 13500:\\
\;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.1000000000000001e72 or 8e17 < (*.f64 x y) Initial program 94.5%
Taylor expanded in x around inf 73.1%
if -2.1000000000000001e72 < (*.f64 x y) < 1.3499999999999999e-110 or 13500 < (*.f64 x y) < 8e17Initial program 100.0%
Taylor expanded in a around inf 75.6%
*-commutative75.6%
associate-*r*75.6%
Simplified75.6%
if 1.3499999999999999e-110 < (*.f64 x y) < 13500Initial program 100.0%
Taylor expanded in z around inf 53.8%
Final simplification72.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (* b -0.25))))
(if (<= (* x y) -9e+71)
(* x y)
(if (<= (* x y) -1e-310)
t_1
(if (<= (* x y) 2.2e-243) c (if (<= (* x y) 6e+17) 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) <= -9e+71) {
tmp = x * y;
} else if ((x * y) <= -1e-310) {
tmp = t_1;
} else if ((x * y) <= 2.2e-243) {
tmp = c;
} else if ((x * y) <= 6e+17) {
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) <= (-9d+71)) then
tmp = x * y
else if ((x * y) <= (-1d-310)) then
tmp = t_1
else if ((x * y) <= 2.2d-243) then
tmp = c
else if ((x * y) <= 6d+17) 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) <= -9e+71) {
tmp = x * y;
} else if ((x * y) <= -1e-310) {
tmp = t_1;
} else if ((x * y) <= 2.2e-243) {
tmp = c;
} else if ((x * y) <= 6e+17) {
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) <= -9e+71: tmp = x * y elif (x * y) <= -1e-310: tmp = t_1 elif (x * y) <= 2.2e-243: tmp = c elif (x * y) <= 6e+17: 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) <= -9e+71) tmp = Float64(x * y); elseif (Float64(x * y) <= -1e-310) tmp = t_1; elseif (Float64(x * y) <= 2.2e-243) tmp = c; elseif (Float64(x * y) <= 6e+17) 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) <= -9e+71) tmp = x * y; elseif ((x * y) <= -1e-310) tmp = t_1; elseif ((x * y) <= 2.2e-243) tmp = c; elseif ((x * y) <= 6e+17) 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], -9e+71], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-310], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-243], c, If[LessEqual[N[(x * y), $MachinePrecision], 6e+17], 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 -9 \cdot 10^{+71}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-243}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.00000000000000087e71 or 6e17 < (*.f64 x y) Initial program 94.5%
Taylor expanded in z around 0 79.2%
Taylor expanded in c around 0 68.8%
Taylor expanded in x around inf 63.0%
if -9.00000000000000087e71 < (*.f64 x y) < -9.999999999999969e-311 or 2.1999999999999999e-243 < (*.f64 x y) < 6e17Initial program 100.0%
Taylor expanded in z around 0 73.1%
Taylor expanded in c around 0 51.8%
Taylor expanded in x around 0 46.2%
*-commutative46.2%
associate-*r*46.2%
*-commutative46.2%
Simplified46.2%
if -9.999999999999969e-311 < (*.f64 x y) < 2.1999999999999999e-243Initial program 100.0%
Taylor expanded in z around 0 74.5%
Taylor expanded in c around inf 46.4%
Final simplification53.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.0625 (* z t))))
(if (or (<= (* x y) -1.15e+73) (not (<= (* x y) 2.7e+17)))
(+ 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) <= -1.15e+73) || !((x * y) <= 2.7e+17)) {
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) <= (-1.15d+73)) .or. (.not. ((x * y) <= 2.7d+17))) 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) <= -1.15e+73) || !((x * y) <= 2.7e+17)) {
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) <= -1.15e+73) or not ((x * y) <= 2.7e+17): 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) <= -1.15e+73) || !(Float64(x * y) <= 2.7e+17)) tmp = Float64(c + Float64(Float64(x * y) + t_1)); else tmp = Float64(c + Float64(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) <= -1.15e+73) || ~(((x * y) <= 2.7e+17))) 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], -1.15e+73], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.7e+17]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $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^{+73} \lor \neg \left(x \cdot y \leq 2.7 \cdot 10^{+17}\right):\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(t\_1 - \left(a \cdot b\right) \cdot 0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15e73 or 2.7e17 < (*.f64 x y) Initial program 94.5%
Taylor expanded in a around 0 87.6%
if -1.15e73 < (*.f64 x y) < 2.7e17Initial program 100.0%
Taylor expanded in x around 0 95.9%
Final simplification92.5%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* a b) -5e+70) (not (<= (* a b) 5e+60))) (+ c (- (* x y) (* (* a b) 0.25))) (+ c (+ (* x y) (* 0.0625 (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+70) || !((a * b) <= 5e+60)) {
tmp = c + ((x * y) - ((a * b) * 0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (((a * b) <= (-5d+70)) .or. (.not. ((a * b) <= 5d+60))) then
tmp = c + ((x * y) - ((a * b) * 0.25d0))
else
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((a * b) <= -5e+70) || !((a * b) <= 5e+60)) {
tmp = c + ((x * y) - ((a * b) * 0.25));
} else {
tmp = c + ((x * y) + (0.0625 * (z * t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((a * b) <= -5e+70) or not ((a * b) <= 5e+60): tmp = c + ((x * y) - ((a * b) * 0.25)) else: tmp = c + ((x * y) + (0.0625 * (z * t))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(a * b) <= -5e+70) || !(Float64(a * b) <= 5e+60)) tmp = Float64(c + Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))); else tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (((a * b) <= -5e+70) || ~(((a * b) <= 5e+60))) tmp = c + ((x * y) - ((a * b) * 0.25)); else tmp = c + ((x * y) + (0.0625 * (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+70], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+60]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+70} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+60}\right):\\
\;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \cdot 0.25\right)\\
\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.0000000000000002e70 or 4.99999999999999975e60 < (*.f64 a b) Initial program 95.6%
Taylor expanded in z around 0 80.9%
if -5.0000000000000002e70 < (*.f64 a b) < 4.99999999999999975e60Initial program 99.3%
Taylor expanded in a around 0 94.2%
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) -1e+92)
(- t_2 t_1)
(if (<= (* a b) 5e+60) (+ c (+ (* x y) t_2)) (+ c (- (* x y) 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) <= -1e+92) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+60) {
tmp = c + ((x * y) + t_2);
} else {
tmp = c + ((x * y) - 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) <= (-1d+92)) then
tmp = t_2 - t_1
else if ((a * b) <= 5d+60) then
tmp = c + ((x * y) + t_2)
else
tmp = c + ((x * y) - 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) <= -1e+92) {
tmp = t_2 - t_1;
} else if ((a * b) <= 5e+60) {
tmp = c + ((x * y) + t_2);
} else {
tmp = c + ((x * y) - 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) <= -1e+92: tmp = t_2 - t_1 elif (a * b) <= 5e+60: tmp = c + ((x * y) + t_2) else: tmp = c + ((x * y) - 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) <= -1e+92) tmp = Float64(t_2 - t_1); elseif (Float64(a * b) <= 5e+60) tmp = Float64(c + Float64(Float64(x * y) + t_2)); else tmp = Float64(c + Float64(Float64(x * y) - 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) <= -1e+92) tmp = t_2 - t_1; elseif ((a * b) <= 5e+60) tmp = c + ((x * y) + t_2); else tmp = c + ((x * y) - 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], -1e+92], N[(t$95$2 - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+60], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] - t$95$1), $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}\;a \cdot b \leq -1 \cdot 10^{+92}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+60}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1e92Initial program 92.6%
Taylor expanded in x around 0 89.8%
Taylor expanded in c around 0 80.6%
if -1e92 < (*.f64 a b) < 4.99999999999999975e60Initial program 99.3%
Taylor expanded in a around 0 93.7%
if 4.99999999999999975e60 < (*.f64 a b) Initial program 98.1%
Taylor expanded in z around 0 83.7%
Final simplification88.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<= (* a b) -1e+72)
(+ c (* a (* b -0.25)))
(if (<= (* a b) 5e+60)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(- (* x y) (* (* 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) <= -1e+72) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+60) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((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) <= (-1d+72)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 5d+60) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = (x * y) - ((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) <= -1e+72) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+60) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+72: tmp = c + (a * (b * -0.25)) elif (a * b) <= 5e+60: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+72) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 5e+60) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(Float64(x * y) - 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) <= -1e+72) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 5e+60) tmp = c + ((x * y) + (0.0625 * (z * t))); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+72], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+60], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+72}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+60}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999944e71Initial program 92.9%
Taylor expanded in a around inf 72.8%
*-commutative72.8%
associate-*r*74.4%
Simplified74.4%
if -9.99999999999999944e71 < (*.f64 a b) < 4.99999999999999975e60Initial program 99.3%
Taylor expanded in a around 0 94.3%
if 4.99999999999999975e60 < (*.f64 a b) Initial program 98.1%
Taylor expanded in z around 0 83.7%
Taylor expanded in c around 0 71.6%
Final simplification85.3%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* a b) -1e+72) (+ c (* a (* b -0.25))) (if (<= (* a b) 5e+60) (+ c (* x y)) (- (* x y) (* (* 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) <= -1e+72) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+60) {
tmp = c + (x * y);
} else {
tmp = (x * y) - ((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) <= (-1d+72)) then
tmp = c + (a * (b * (-0.25d0)))
else if ((a * b) <= 5d+60) then
tmp = c + (x * y)
else
tmp = (x * y) - ((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) <= -1e+72) {
tmp = c + (a * (b * -0.25));
} else if ((a * b) <= 5e+60) {
tmp = c + (x * y);
} else {
tmp = (x * y) - ((a * b) * 0.25);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (a * b) <= -1e+72: tmp = c + (a * (b * -0.25)) elif (a * b) <= 5e+60: tmp = c + (x * y) else: tmp = (x * y) - ((a * b) * 0.25) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(a * b) <= -1e+72) tmp = Float64(c + Float64(a * Float64(b * -0.25))); elseif (Float64(a * b) <= 5e+60) tmp = Float64(c + Float64(x * y)); else tmp = Float64(Float64(x * y) - 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) <= -1e+72) tmp = c + (a * (b * -0.25)); elseif ((a * b) <= 5e+60) tmp = c + (x * y); else tmp = (x * y) - ((a * b) * 0.25); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+72], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+60], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+72}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+60}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999944e71Initial program 92.9%
Taylor expanded in a around inf 72.8%
*-commutative72.8%
associate-*r*74.4%
Simplified74.4%
if -9.99999999999999944e71 < (*.f64 a b) < 4.99999999999999975e60Initial program 99.3%
Taylor expanded in x around inf 68.0%
if 4.99999999999999975e60 < (*.f64 a b) Initial program 98.1%
Taylor expanded in z around 0 83.7%
Taylor expanded in c around 0 71.6%
Final simplification70.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* 0.0625 (* z t)))))
(if (<= t -1.55e-15)
t_1
(if (<= t 3e+90)
(+ c (* x y))
(if (<= t 9.2e+138) (* a (* b -0.25)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c + (0.0625 * (z * t));
double tmp;
if (t <= -1.55e-15) {
tmp = t_1;
} else if (t <= 3e+90) {
tmp = c + (x * y);
} else if (t <= 9.2e+138) {
tmp = a * (b * -0.25);
} 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 + (0.0625d0 * (z * t))
if (t <= (-1.55d-15)) then
tmp = t_1
else if (t <= 3d+90) then
tmp = c + (x * y)
else if (t <= 9.2d+138) then
tmp = a * (b * (-0.25d0))
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 + (0.0625 * (z * t));
double tmp;
if (t <= -1.55e-15) {
tmp = t_1;
} else if (t <= 3e+90) {
tmp = c + (x * y);
} else if (t <= 9.2e+138) {
tmp = a * (b * -0.25);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = c + (0.0625 * (z * t)) tmp = 0 if t <= -1.55e-15: tmp = t_1 elif t <= 3e+90: tmp = c + (x * y) elif t <= 9.2e+138: tmp = a * (b * -0.25) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(c + Float64(0.0625 * Float64(z * t))) tmp = 0.0 if (t <= -1.55e-15) tmp = t_1; elseif (t <= 3e+90) tmp = Float64(c + Float64(x * y)); elseif (t <= 9.2e+138) tmp = Float64(a * Float64(b * -0.25)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = c + (0.0625 * (z * t)); tmp = 0.0; if (t <= -1.55e-15) tmp = t_1; elseif (t <= 3e+90) tmp = c + (x * y); elseif (t <= 9.2e+138) tmp = a * (b * -0.25); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-15], t$95$1, If[LessEqual[t, 3e+90], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e+138], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+90}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+138}:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5499999999999999e-15 or 9.2000000000000003e138 < t Initial program 96.8%
Taylor expanded in z around inf 62.2%
if -1.5499999999999999e-15 < t < 2.99999999999999979e90Initial program 98.8%
Taylor expanded in x around inf 59.8%
if 2.99999999999999979e90 < t < 9.2000000000000003e138Initial program 85.7%
Taylor expanded in z around 0 72.0%
Taylor expanded in c around 0 72.0%
Taylor expanded in x around 0 43.8%
*-commutative43.8%
associate-*r*43.8%
*-commutative43.8%
Simplified43.8%
Final simplification60.2%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= (* x y) -3.9e+161) (not (<= (* x y) 5.1e-92))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (((x * y) <= -3.9e+161) || !((x * y) <= 5.1e-92)) {
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) <= (-3.9d+161)) .or. (.not. ((x * y) <= 5.1d-92))) 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) <= -3.9e+161) || !((x * y) <= 5.1e-92)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if ((x * y) <= -3.9e+161) or not ((x * y) <= 5.1e-92): tmp = x * y else: tmp = c return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if ((Float64(x * y) <= -3.9e+161) || !(Float64(x * y) <= 5.1e-92)) 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) <= -3.9e+161) || ~(((x * y) <= 5.1e-92))) 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], -3.9e+161], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.1e-92]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.9 \cdot 10^{+161} \lor \neg \left(x \cdot y \leq 5.1 \cdot 10^{-92}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -3.9000000000000002e161 or 5.09999999999999972e-92 < (*.f64 x y) Initial program 94.9%
Taylor expanded in z around 0 77.8%
Taylor expanded in c around 0 71.5%
Taylor expanded in x around inf 59.4%
if -3.9000000000000002e161 < (*.f64 x y) < 5.09999999999999972e-92Initial program 100.0%
Taylor expanded in z around 0 74.4%
Taylor expanded in c around inf 34.9%
Final simplification45.9%
(FPCore (x y z t a b c) :precision binary64 (+ c (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c + (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c): return c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0))
function code(x, y, z, t, a, b, c) return Float64(c + Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))) end
function tmp = code(x, y, z, t, a, b, c) tmp = c + (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Initial program 97.7%
Final simplification97.7%
(FPCore (x y z t a b c) :precision binary64 (if (or (<= b -8e-84) (not (<= b 1.55e+154))) (* 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 ((b <= -8e-84) || !(b <= 1.55e+154)) {
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 ((b <= (-8d-84)) .or. (.not. (b <= 1.55d+154))) 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 ((b <= -8e-84) || !(b <= 1.55e+154)) {
tmp = a * (b * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (b <= -8e-84) or not (b <= 1.55e+154): 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 ((b <= -8e-84) || !(b <= 1.55e+154)) 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 ((b <= -8e-84) || ~((b <= 1.55e+154))) 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[b, -8e-84], N[Not[LessEqual[b, 1.55e+154]], $MachinePrecision]], N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{-84} \lor \neg \left(b \leq 1.55 \cdot 10^{+154}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if b < -8.0000000000000003e-84 or 1.5500000000000001e154 < b Initial program 96.7%
Taylor expanded in z around 0 77.3%
Taylor expanded in c around 0 64.1%
Taylor expanded in x around 0 43.7%
*-commutative43.7%
associate-*r*44.4%
*-commutative44.4%
Simplified44.4%
if -8.0000000000000003e-84 < b < 1.5500000000000001e154Initial program 98.6%
Taylor expanded in x around inf 60.5%
Final simplification53.1%
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return c;
}
def code(x, y, z, t, a, b, c): return c
function code(x, y, z, t, a, b, c) return c end
function tmp = code(x, y, z, t, a, b, c) tmp = c; end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
\\
c
\end{array}
Initial program 97.7%
Taylor expanded in z around 0 75.9%
Taylor expanded in c around inf 23.2%
herbie shell --seed 2024103
(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))