
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* t (- z (/ (* c (* (* b c) i)) t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * (t * (z - ((c * ((b * c) * i)) / t)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t * Float64(z - Float64(Float64(c * Float64(Float64(b * c) * i)) / t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * N[(z - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 93.0%
fma-define93.0%
associate-*l*98.0%
Simplified98.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 33.3%
Taylor expanded in t around inf 77.8%
Taylor expanded in a around 0 88.9%
associate-*r*88.9%
*-commutative88.9%
*-commutative88.9%
Simplified88.9%
Final simplification97.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (or (<= t_1 -2e+263) (not (<= t_1 1e+267)))
(* 2.0 (- (* x y) (* (* c i) (fma b c a))))
(* (- (+ (* x y) (* z t)) (* t_1 i)) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (a + (b * c));
double tmp;
if ((t_1 <= -2e+263) || !(t_1 <= 1e+267)) {
tmp = 2.0 * ((x * y) - ((c * i) * fma(b, c, a)));
} else {
tmp = (((x * y) + (z * t)) - (t_1 * i)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if ((t_1 <= -2e+263) || !(t_1 <= 1e+267)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(c * i) * fma(b, c, a)))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_1 * i)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+263], N[Not[LessEqual[t$95$1, 1e+267]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(c * i), $MachinePrecision] * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+263} \lor \neg \left(t\_1 \leq 10^{+267}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - \left(c \cdot i\right) \cdot \mathsf{fma}\left(b, c, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_1 \cdot i\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -2.00000000000000003e263 or 9.9999999999999997e266 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 70.0%
Taylor expanded in z around 0 93.5%
associate-*r*93.5%
+-commutative93.5%
fma-undefine93.5%
Simplified93.5%
if -2.00000000000000003e263 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999997e266Initial program 98.2%
Final simplification96.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -2e+122)
t_2
(if (<= (* x y) -4e+28)
t_1
(if (<= (* x y) -200000000000.0)
t_2
(if (<= (* x y) -5e-44)
(* -2.0 (* i (* a c)))
(if (<= (* x y) -2e-102)
t_1
(if (<= (* x y) 5e-52)
(* 2.0 (* z t))
(if (<= (* x y) 5e+66) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -4e+28) {
tmp = t_1;
} else if ((x * y) <= -200000000000.0) {
tmp = t_2;
} else if ((x * y) <= -5e-44) {
tmp = -2.0 * (i * (a * c));
} else if ((x * y) <= -2e-102) {
tmp = t_1;
} else if ((x * y) <= 5e-52) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (a * (c * i))
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-2d+122)) then
tmp = t_2
else if ((x * y) <= (-4d+28)) then
tmp = t_1
else if ((x * y) <= (-200000000000.0d0)) then
tmp = t_2
else if ((x * y) <= (-5d-44)) then
tmp = (-2.0d0) * (i * (a * c))
else if ((x * y) <= (-2d-102)) then
tmp = t_1
else if ((x * y) <= 5d-52) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 5d+66) 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 i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -4e+28) {
tmp = t_1;
} else if ((x * y) <= -200000000000.0) {
tmp = t_2;
} else if ((x * y) <= -5e-44) {
tmp = -2.0 * (i * (a * c));
} else if ((x * y) <= -2e-102) {
tmp = t_1;
} else if ((x * y) <= 5e-52) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e+122: tmp = t_2 elif (x * y) <= -4e+28: tmp = t_1 elif (x * y) <= -200000000000.0: tmp = t_2 elif (x * y) <= -5e-44: tmp = -2.0 * (i * (a * c)) elif (x * y) <= -2e-102: tmp = t_1 elif (x * y) <= 5e-52: tmp = 2.0 * (z * t) elif (x * y) <= 5e+66: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e+122) tmp = t_2; elseif (Float64(x * y) <= -4e+28) tmp = t_1; elseif (Float64(x * y) <= -200000000000.0) tmp = t_2; elseif (Float64(x * y) <= -5e-44) tmp = Float64(-2.0 * Float64(i * Float64(a * c))); elseif (Float64(x * y) <= -2e-102) tmp = t_1; elseif (Float64(x * y) <= 5e-52) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 5e+66) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e+122) tmp = t_2; elseif ((x * y) <= -4e+28) tmp = t_1; elseif ((x * y) <= -200000000000.0) tmp = t_2; elseif ((x * y) <= -5e-44) tmp = -2.0 * (i * (a * c)); elseif ((x * y) <= -2e-102) tmp = t_1; elseif ((x * y) <= 5e-52) tmp = 2.0 * (z * t); elseif ((x * y) <= 5e+66) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+122], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4e+28], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -200000000000.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e-44], N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-102], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-52], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+66], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -200000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-44}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-52}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000003e122 or -3.99999999999999983e28 < (*.f64 x y) < -2e11 or 4.99999999999999991e66 < (*.f64 x y) Initial program 90.8%
Taylor expanded in x around inf 64.7%
if -2.00000000000000003e122 < (*.f64 x y) < -3.99999999999999983e28 or -5.00000000000000039e-44 < (*.f64 x y) < -1.99999999999999987e-102 or 5e-52 < (*.f64 x y) < 4.99999999999999991e66Initial program 96.5%
Taylor expanded in a around inf 47.0%
mul-1-neg47.0%
*-commutative47.0%
associate-*l*35.2%
*-commutative35.2%
distribute-rgt-neg-in35.2%
*-commutative35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Taylor expanded in c around 0 47.0%
*-commutative47.0%
Simplified47.0%
if -2e11 < (*.f64 x y) < -5.00000000000000039e-44Initial program 93.7%
Taylor expanded in a around inf 56.8%
Taylor expanded in a around inf 35.6%
*-commutative35.6%
associate-*r*41.5%
*-commutative41.5%
Simplified41.5%
if -1.99999999999999987e-102 < (*.f64 x y) < 5e-52Initial program 84.5%
Taylor expanded in z around inf 45.1%
Final simplification51.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (* t (- z (/ t_3 t))))
(if (<= t_2 2e+284) (* (- (+ (* x y) (* z t)) t_2) 2.0) (* t_3 -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (t * (z - (t_3 / t)));
} else if (t_2 <= 2e+284) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = t_3 * -2.0;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t * (z - (t_3 / t)));
} else if (t_2 <= 2e+284) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = t_3 * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i t_3 = c * (t_1 * i) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * (t * (z - (t_3 / t))) elif t_2 <= 2e+284: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = t_3 * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) t_3 = Float64(c * Float64(t_1 * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(t * Float64(z - Float64(t_3 / t)))); elseif (t_2 <= 2e+284) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(t_3 * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; t_3 = c * (t_1 * i); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * (t * (z - (t_3 / t))); elseif (t_2 <= 2e+284) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = t_3 * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(t * N[(z - N[(t$95$3 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+284], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(t$95$3 * -2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := c \cdot \left(t\_1 \cdot i\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z - \frac{t\_3}{t}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 75.8%
Taylor expanded in x around 0 87.3%
Taylor expanded in t around inf 90.5%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000016e284Initial program 98.7%
if 2.00000000000000016e284 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 69.7%
Taylor expanded in x around 0 89.5%
Taylor expanded in t around inf 89.8%
Taylor expanded in t around 0 94.8%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))) (t_2 (* (* x y) 2.0)))
(if (<= (* x y) -2e+122)
t_2
(if (<= (* x y) -2e-102)
t_1
(if (<= (* x y) 5e-52)
(* 2.0 (* z t))
(if (<= (* x y) 5e+66) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -2e-102) {
tmp = t_1;
} else if ((x * y) <= 5e-52) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (a * (c * i))
t_2 = (x * y) * 2.0d0
if ((x * y) <= (-2d+122)) then
tmp = t_2
else if ((x * y) <= (-2d-102)) then
tmp = t_1
else if ((x * y) <= 5d-52) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 5d+66) 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 i) {
double t_1 = -2.0 * (a * (c * i));
double t_2 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e+122) {
tmp = t_2;
} else if ((x * y) <= -2e-102) {
tmp = t_1;
} else if ((x * y) <= 5e-52) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 5e+66) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e+122: tmp = t_2 elif (x * y) <= -2e-102: tmp = t_1 elif (x * y) <= 5e-52: tmp = 2.0 * (z * t) elif (x * y) <= 5e+66: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e+122) tmp = t_2; elseif (Float64(x * y) <= -2e-102) tmp = t_1; elseif (Float64(x * y) <= 5e-52) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 5e+66) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); t_2 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e+122) tmp = t_2; elseif ((x * y) <= -2e-102) tmp = t_1; elseif ((x * y) <= 5e-52) tmp = 2.0 * (z * t); elseif ((x * y) <= 5e+66) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+122], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2e-102], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-52], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+66], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-52}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000003e122 or 4.99999999999999991e66 < (*.f64 x y) Initial program 90.1%
Taylor expanded in x around inf 64.5%
if -2.00000000000000003e122 < (*.f64 x y) < -1.99999999999999987e-102 or 5e-52 < (*.f64 x y) < 4.99999999999999991e66Initial program 96.2%
Taylor expanded in a around inf 41.2%
mul-1-neg41.2%
*-commutative41.2%
associate-*l*33.8%
*-commutative33.8%
distribute-rgt-neg-in33.8%
*-commutative33.8%
distribute-rgt-neg-in33.8%
Simplified33.8%
Taylor expanded in c around 0 41.2%
*-commutative41.2%
Simplified41.2%
if -1.99999999999999987e-102 < (*.f64 x y) < 5e-52Initial program 84.5%
Taylor expanded in z around inf 45.1%
Final simplification50.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -3.5e+159)
(and (not (<= c -4.7e+114))
(or (<= c -46000000.0) (not (<= c 1.1e+40)))))
(* (* c (* (+ a (* b c)) i)) -2.0)
(* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -3.5e+159) || (!(c <= -4.7e+114) && ((c <= -46000000.0) || !(c <= 1.1e+40)))) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-3.5d+159)) .or. (.not. (c <= (-4.7d+114))) .and. (c <= (-46000000.0d0)) .or. (.not. (c <= 1.1d+40))) then
tmp = (c * ((a + (b * c)) * i)) * (-2.0d0)
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 i) {
double tmp;
if ((c <= -3.5e+159) || (!(c <= -4.7e+114) && ((c <= -46000000.0) || !(c <= 1.1e+40)))) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -3.5e+159) or (not (c <= -4.7e+114) and ((c <= -46000000.0) or not (c <= 1.1e+40))): tmp = (c * ((a + (b * c)) * i)) * -2.0 else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -3.5e+159) || (!(c <= -4.7e+114) && ((c <= -46000000.0) || !(c <= 1.1e+40)))) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -3.5e+159) || (~((c <= -4.7e+114)) && ((c <= -46000000.0) || ~((c <= 1.1e+40))))) tmp = (c * ((a + (b * c)) * i)) * -2.0; else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.5e+159], And[N[Not[LessEqual[c, -4.7e+114]], $MachinePrecision], Or[LessEqual[c, -46000000.0], N[Not[LessEqual[c, 1.1e+40]], $MachinePrecision]]]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{+159} \lor \neg \left(c \leq -4.7 \cdot 10^{+114}\right) \land \left(c \leq -46000000 \lor \neg \left(c \leq 1.1 \cdot 10^{+40}\right)\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -3.4999999999999999e159 or -4.7000000000000001e114 < c < -4.6e7 or 1.0999999999999999e40 < c Initial program 79.9%
Taylor expanded in x around 0 87.5%
Taylor expanded in t around inf 83.8%
Taylor expanded in t around 0 84.8%
if -3.4999999999999999e159 < c < -4.7000000000000001e114 or -4.6e7 < c < 1.0999999999999999e40Initial program 96.2%
Taylor expanded in c around 0 74.9%
Final simplification78.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* (+ a (* b c)) i)) -2.0)))
(if (<= c -1.02e+158)
t_1
(if (<= c -2.7e+92)
(* 2.0 (- (* z t) (* a (* c i))))
(if (or (<= c -4500000.0) (not (<= c 2.6e+39)))
t_1
(* (+ (* x y) (* z t)) 2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -2.7e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if ((c <= -4500000.0) || !(c <= 2.6e+39)) {
tmp = t_1;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * ((a + (b * c)) * i)) * (-2.0d0)
if (c <= (-1.02d+158)) then
tmp = t_1
else if (c <= (-2.7d+92)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if ((c <= (-4500000.0d0)) .or. (.not. (c <= 2.6d+39))) then
tmp = t_1
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -2.7e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if ((c <= -4500000.0) || !(c <= 2.6e+39)) {
tmp = t_1;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * ((a + (b * c)) * i)) * -2.0 tmp = 0 if c <= -1.02e+158: tmp = t_1 elif c <= -2.7e+92: tmp = 2.0 * ((z * t) - (a * (c * i))) elif (c <= -4500000.0) or not (c <= 2.6e+39): tmp = t_1 else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0) tmp = 0.0 if (c <= -1.02e+158) tmp = t_1; elseif (c <= -2.7e+92) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif ((c <= -4500000.0) || !(c <= 2.6e+39)) tmp = t_1; else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * ((a + (b * c)) * i)) * -2.0; tmp = 0.0; if (c <= -1.02e+158) tmp = t_1; elseif (c <= -2.7e+92) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif ((c <= -4500000.0) || ~((c <= 2.6e+39))) tmp = t_1; else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.02e+158], t$95$1, If[LessEqual[c, -2.7e+92], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, -4500000.0], N[Not[LessEqual[c, 2.6e+39]], $MachinePrecision]], t$95$1, N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -1.02 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -2.7 \cdot 10^{+92}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -4500000 \lor \neg \left(c \leq 2.6 \cdot 10^{+39}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.02e158 or -2.6999999999999999e92 < c < -4.5e6 or 2.6e39 < c Initial program 79.2%
Taylor expanded in x around 0 86.8%
Taylor expanded in t around inf 84.3%
Taylor expanded in t around 0 85.0%
if -1.02e158 < c < -2.6999999999999999e92Initial program 76.5%
Taylor expanded in x around 0 94.2%
Taylor expanded in c around 0 86.9%
mul-1-neg86.9%
+-commutative86.9%
sub-neg86.9%
Simplified86.9%
if -4.5e6 < c < 2.6e39Initial program 97.9%
Taylor expanded in c around 0 74.7%
Final simplification79.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* (+ a (* b c)) i)) -2.0)))
(if (<= c -1.02e+158)
t_1
(if (<= c -5e+92)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c -8000000.0)
(* 2.0 (- (* z t) (* c (* c (* b i)))))
(if (<= c 4e+38) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -5e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -8000000.0) {
tmp = 2.0 * ((z * t) - (c * (c * (b * i))));
} else if (c <= 4e+38) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * ((a + (b * c)) * i)) * (-2.0d0)
if (c <= (-1.02d+158)) then
tmp = t_1
else if (c <= (-5d+92)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= (-8000000.0d0)) then
tmp = 2.0d0 * ((z * t) - (c * (c * (b * i))))
else if (c <= 4d+38) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -5e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -8000000.0) {
tmp = 2.0 * ((z * t) - (c * (c * (b * i))));
} else if (c <= 4e+38) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * ((a + (b * c)) * i)) * -2.0 tmp = 0 if c <= -1.02e+158: tmp = t_1 elif c <= -5e+92: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= -8000000.0: tmp = 2.0 * ((z * t) - (c * (c * (b * i)))) elif c <= 4e+38: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0) tmp = 0.0 if (c <= -1.02e+158) tmp = t_1; elseif (c <= -5e+92) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= -8000000.0) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(c * Float64(b * i))))); elseif (c <= 4e+38) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * ((a + (b * c)) * i)) * -2.0; tmp = 0.0; if (c <= -1.02e+158) tmp = t_1; elseif (c <= -5e+92) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= -8000000.0) tmp = 2.0 * ((z * t) - (c * (c * (b * i)))); elseif (c <= 4e+38) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.02e+158], t$95$1, If[LessEqual[c, -5e+92], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -8000000.0], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4e+38], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -1.02 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -5 \cdot 10^{+92}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -8000000:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 4 \cdot 10^{+38}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.02e158 or 3.99999999999999991e38 < c Initial program 78.7%
Taylor expanded in x around 0 87.8%
Taylor expanded in t around inf 85.9%
Taylor expanded in t around 0 89.2%
if -1.02e158 < c < -5.00000000000000022e92Initial program 76.5%
Taylor expanded in x around 0 94.2%
Taylor expanded in c around 0 86.9%
mul-1-neg86.9%
+-commutative86.9%
sub-neg86.9%
Simplified86.9%
if -5.00000000000000022e92 < c < -8e6Initial program 81.9%
Taylor expanded in x around 0 81.9%
Taylor expanded in c around inf 87.4%
Taylor expanded in c around inf 81.2%
*-commutative81.2%
associate-*r*81.3%
Simplified81.3%
if -8e6 < c < 3.99999999999999991e38Initial program 97.9%
Taylor expanded in c around 0 74.7%
Final simplification80.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* (+ a (* b c)) i)) -2.0)))
(if (<= c -1.02e+158)
t_1
(if (<= c -5e+92)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c -270000.0)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
(if (<= c 2.2e+40) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -5e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -270000.0) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 2.2e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * ((a + (b * c)) * i)) * (-2.0d0)
if (c <= (-1.02d+158)) then
tmp = t_1
else if (c <= (-5d+92)) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= (-270000.0d0)) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
else if (c <= 2.2d+40) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 i) {
double t_1 = (c * ((a + (b * c)) * i)) * -2.0;
double tmp;
if (c <= -1.02e+158) {
tmp = t_1;
} else if (c <= -5e+92) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= -270000.0) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else if (c <= 2.2e+40) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * ((a + (b * c)) * i)) * -2.0 tmp = 0 if c <= -1.02e+158: tmp = t_1 elif c <= -5e+92: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= -270000.0: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) elif c <= 2.2e+40: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0) tmp = 0.0 if (c <= -1.02e+158) tmp = t_1; elseif (c <= -5e+92) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= -270000.0) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 2.2e+40) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * ((a + (b * c)) * i)) * -2.0; tmp = 0.0; if (c <= -1.02e+158) tmp = t_1; elseif (c <= -5e+92) tmp = 2.0 * ((z * t) - (a * (c * i))); elseif (c <= -270000.0) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); elseif (c <= 2.2e+40) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.02e+158], t$95$1, If[LessEqual[c, -5e+92], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -270000.0], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e+40], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -1.02 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -5 \cdot 10^{+92}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq -270000:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.02e158 or 2.1999999999999999e40 < c Initial program 78.7%
Taylor expanded in x around 0 87.8%
Taylor expanded in t around inf 85.9%
Taylor expanded in t around 0 89.2%
if -1.02e158 < c < -5.00000000000000022e92Initial program 76.5%
Taylor expanded in x around 0 94.2%
Taylor expanded in c around 0 86.9%
mul-1-neg86.9%
+-commutative86.9%
sub-neg86.9%
Simplified86.9%
if -5.00000000000000022e92 < c < -2.7e5Initial program 81.9%
Taylor expanded in x around 0 81.9%
Taylor expanded in a around 0 81.2%
if -2.7e5 < c < 2.1999999999999999e40Initial program 97.9%
Taylor expanded in c around 0 74.7%
Final simplification80.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.8e-129) (not (<= c 2900000000.0))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.8e-129) || !(c <= 2900000000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.8d-129)) .or. (.not. (c <= 2900000000.0d0))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
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 i) {
double tmp;
if ((c <= -5.8e-129) || !(c <= 2900000000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.8e-129) or not (c <= 2900000000.0): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.8e-129) || !(c <= 2900000000.0)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -5.8e-129) || ~((c <= 2900000000.0))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.8e-129], N[Not[LessEqual[c, 2900000000.0]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.8 \cdot 10^{-129} \lor \neg \left(c \leq 2900000000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -5.80000000000000034e-129 or 2.9e9 < c Initial program 84.3%
Taylor expanded in x around 0 81.8%
if -5.80000000000000034e-129 < c < 2.9e9Initial program 97.2%
Taylor expanded in c around 0 79.2%
Final simplification80.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -2.3e+31)
(* 2.0 (- (* z t) t_1))
(if (<= c 2.6e+100)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* t_1 -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.3e+31) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 2.6e+100) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-2.3d+31)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 2.6d+100) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = t_1 * (-2.0d0)
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 i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.3e+31) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 2.6e+100) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -2.3e+31: tmp = 2.0 * ((z * t) - t_1) elif c <= 2.6e+100: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = t_1 * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -2.3e+31) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 2.6e+100) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(t_1 * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -2.3e+31) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 2.6e+100) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = t_1 * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.3e+31], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.6e+100], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -2.3 \cdot 10^{+31}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{+100}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot -2\\
\end{array}
\end{array}
if c < -2.3e31Initial program 73.3%
Taylor expanded in x around 0 87.7%
if -2.3e31 < c < 2.6000000000000002e100Initial program 97.5%
Taylor expanded in a around inf 90.7%
*-commutative90.7%
Simplified90.7%
if 2.6000000000000002e100 < c Initial program 81.4%
Taylor expanded in x around 0 88.1%
Taylor expanded in t around inf 86.2%
Taylor expanded in t around 0 92.8%
Final simplification90.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -2.65e+31)
(* 2.0 (- (* z t) t_1))
(if (<= c 1.9e+97)
(* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))
(* t_1 -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.65e+31) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.9e+97) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-2.65d+31)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 1.9d+97) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
else
tmp = t_1 * (-2.0d0)
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 i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.65e+31) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.9e+97) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = t_1 * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -2.65e+31: tmp = 2.0 * ((z * t) - t_1) elif c <= 1.9e+97: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = t_1 * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -2.65e+31) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 1.9e+97) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(t_1 * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -2.65e+31) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 1.9e+97) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = t_1 * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.65e+31], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.9e+97], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * -2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -2.65 \cdot 10^{+31}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 1.9 \cdot 10^{+97}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot -2\\
\end{array}
\end{array}
if c < -2.6500000000000002e31Initial program 73.3%
Taylor expanded in x around 0 87.7%
if -2.6500000000000002e31 < c < 1.90000000000000018e97Initial program 97.5%
Taylor expanded in a around inf 90.3%
if 1.90000000000000018e97 < c Initial program 81.4%
Taylor expanded in x around 0 88.1%
Taylor expanded in t around inf 86.2%
Taylor expanded in t around 0 92.8%
Final simplification90.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e-55) (not (<= (* x y) 5e+66))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e-55) || !((x * y) <= 5e+66)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d-55)) .or. (.not. ((x * y) <= 5d+66))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (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 i) {
double tmp;
if (((x * y) <= -1e-55) || !((x * y) <= 5e+66)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e-55) or not ((x * y) <= 5e+66): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e-55) || !(Float64(x * y) <= 5e+66)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e-55) || ~(((x * y) <= 5e+66))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e-55], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+66]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-55} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+66}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999995e-56 or 4.99999999999999991e66 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf 48.4%
if -9.99999999999999995e-56 < (*.f64 x y) < 4.99999999999999991e66Initial program 88.0%
Taylor expanded in z around inf 40.1%
Final simplification44.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c 5.5e+119) (* (+ (* x y) (* z t)) 2.0) (* -2.0 (* a (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= 5.5e+119) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (a * (c * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
real(8) :: tmp
if (c <= 5.5d+119) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (a * (c * i))
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 i) {
double tmp;
if (c <= 5.5e+119) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (a * (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= 5.5e+119: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (a * (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= 5.5e+119) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * Float64(a * Float64(c * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= 5.5e+119) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (a * (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, 5.5e+119], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 5.5 \cdot 10^{+119}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if c < 5.5000000000000003e119Initial program 91.5%
Taylor expanded in c around 0 60.4%
if 5.5000000000000003e119 < c Initial program 79.4%
Taylor expanded in a around inf 37.9%
mul-1-neg37.9%
*-commutative37.9%
associate-*l*33.1%
*-commutative33.1%
distribute-rgt-neg-in33.1%
*-commutative33.1%
distribute-rgt-neg-in33.1%
Simplified33.1%
Taylor expanded in c around 0 37.9%
*-commutative37.9%
Simplified37.9%
Final simplification57.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 89.7%
Taylor expanded in z around inf 29.2%
Final simplification29.2%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))