
(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 (<= (- (+ (* z t) (* x y)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (fma y x (* (* b i) (* c (- c))))))))
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 ((((z * t) + (x * y)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(y, x, ((b * i) * (c * -c)));
}
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(z * t) + Float64(x * y)) - 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 * fma(y, x, Float64(Float64(b * i) * Float64(c * Float64(-c))))); 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[(z * t), $MachinePrecision] + N[(x * y), $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[(y * x + N[(N[(b * i), $MachinePrecision] * N[(c * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(z \cdot t + x \cdot y\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 \mathsf{fma}\left(y, x, \left(b \cdot i\right) \cdot \left(c \cdot \left(-c\right)\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.6%
associate-*l*98.4%
fma-def98.4%
Simplified98.4%
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 a around 0 28.6%
unpow228.6%
Simplified28.6%
associate--l+28.6%
*-commutative28.6%
fma-def42.9%
associate-*l*42.9%
Applied egg-rr42.9%
Taylor expanded in z around 0 85.7%
mul-1-neg85.7%
unpow285.7%
*-commutative85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
Simplified85.7%
Final simplification98.0%
(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)))
(if (<= t_3 (- INFINITY))
(* 2.0 (- (* z t) t_2))
(if (<= t_3 5e+216)
(* (- (+ (* z t) (* x y)) (* t_3 i)) 2.0)
(* 2.0 (- (* x y) t_2))))))
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;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 5e+216) {
tmp = (((z * t) + (x * y)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
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;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 5e+216) {
tmp = (((z * t) + (x * y)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
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 tmp = 0 if t_3 <= -math.inf: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 5e+216: tmp = (((z * t) + (x * y)) - (t_3 * i)) * 2.0 else: tmp = 2.0 * ((x * y) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(c * t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 5e+216) tmp = Float64(Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(t_3 * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); 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; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 5e+216) tmp = (((z * t) + (x * y)) - (t_3 * i)) * 2.0; else tmp = 2.0 * ((x * y) - t_2); 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[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+216], N[(N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t_1 \cdot i\right)\\
t_3 := c \cdot t_1\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+216}:\\
\;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - t_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 69.1%
Taylor expanded in x around 0 94.9%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999998e216Initial program 99.4%
if 4.9999999999999998e216 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 77.8%
Taylor expanded in z around 0 95.3%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= c -2.8e-66)
t_1
(if (<= c 1.45e-164)
(* (+ (* z t) (* x y)) 2.0)
(if (<= c 8.5e-48)
t_1
(if (<= c 1.2e-23)
(* 2.0 (- (* x y) (* b (* i (* c c)))))
(if (<= c 2.6e+123)
t_1
(* 2.0 (- (* x y) (* c (* b (* c i))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.8e-66) {
tmp = t_1;
} else if (c <= 1.45e-164) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 8.5e-48) {
tmp = t_1;
} else if (c <= 1.2e-23) {
tmp = 2.0 * ((x * y) - (b * (i * (c * c))));
} else if (c <= 2.6e+123) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) - (c * (b * (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
if (c <= (-2.8d-66)) then
tmp = t_1
else if (c <= 1.45d-164) then
tmp = ((z * t) + (x * y)) * 2.0d0
else if (c <= 8.5d-48) then
tmp = t_1
else if (c <= 1.2d-23) then
tmp = 2.0d0 * ((x * y) - (b * (i * (c * c))))
else if (c <= 2.6d+123) then
tmp = t_1
else
tmp = 2.0d0 * ((x * y) - (c * (b * (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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -2.8e-66) {
tmp = t_1;
} else if (c <= 1.45e-164) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 8.5e-48) {
tmp = t_1;
} else if (c <= 1.2e-23) {
tmp = 2.0 * ((x * y) - (b * (i * (c * c))));
} else if (c <= 2.6e+123) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if c <= -2.8e-66: tmp = t_1 elif c <= 1.45e-164: tmp = ((z * t) + (x * y)) * 2.0 elif c <= 8.5e-48: tmp = t_1 elif c <= 1.2e-23: tmp = 2.0 * ((x * y) - (b * (i * (c * c)))) elif c <= 2.6e+123: tmp = t_1 else: tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (c <= -2.8e-66) tmp = t_1; elseif (c <= 1.45e-164) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); elseif (c <= 8.5e-48) tmp = t_1; elseif (c <= 1.2e-23) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(b * Float64(i * Float64(c * c))))); elseif (c <= 2.6e+123) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); tmp = 0.0; if (c <= -2.8e-66) tmp = t_1; elseif (c <= 1.45e-164) tmp = ((z * t) + (x * y)) * 2.0; elseif (c <= 8.5e-48) tmp = t_1; elseif (c <= 1.2e-23) tmp = 2.0 * ((x * y) - (b * (i * (c * c)))); elseif (c <= 2.6e+123) tmp = t_1; else tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.8e-66], t$95$1, If[LessEqual[c, 1.45e-164], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 8.5e-48], t$95$1, If[LessEqual[c, 1.2e-23], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.6e+123], t$95$1, N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.8 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{-164}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{-23}:\\
\;\;\;\;2 \cdot \left(x \cdot y - b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.8e-66 or 1.45e-164 < c < 8.5000000000000004e-48 or 1.19999999999999998e-23 < c < 2.59999999999999985e123Initial program 91.0%
Taylor expanded in x around 0 87.9%
if -2.8e-66 < c < 1.45e-164Initial program 100.0%
Taylor expanded in c around 0 88.7%
if 8.5000000000000004e-48 < c < 1.19999999999999998e-23Initial program 85.7%
Taylor expanded in a around 0 99.8%
unpow299.8%
Simplified99.8%
associate--l+99.8%
*-commutative99.8%
fma-def99.8%
associate-*l*86.8%
Applied egg-rr86.8%
Taylor expanded in z around 0 86.8%
unpow286.8%
associate-*r*99.8%
associate-*r*100.0%
associate-*r*86.8%
*-commutative86.8%
associate-*l*100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*r*99.8%
Simplified99.8%
if 2.59999999999999985e123 < c Initial program 75.8%
Taylor expanded in a around 0 69.4%
unpow269.4%
Simplified69.4%
Taylor expanded in z around 0 73.4%
*-commutative73.4%
unpow273.4%
associate-*l*86.6%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
Simplified88.7%
Final simplification88.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i)))
(t_2 (+ (* z t) (* x y)))
(t_3 (* 2.0 (- (* x y) t_1))))
(if (<= c -4.5e+89)
t_3
(if (<= c -155000.0)
(* 2.0 (- (* z t) t_1))
(if (<= c 6.8e-162)
(* 2.0 (- t_2 (* i (* a c))))
(if (<= c 4400000000.0) (* 2.0 (- t_2 (* i (* c (* b c))))) t_3))))))
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 t_2 = (z * t) + (x * y);
double t_3 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -4.5e+89) {
tmp = t_3;
} else if (c <= -155000.0) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.8e-162) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} else if (c <= 4400000000.0) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = (z * t) + (x * y)
t_3 = 2.0d0 * ((x * y) - t_1)
if (c <= (-4.5d+89)) then
tmp = t_3
else if (c <= (-155000.0d0)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 6.8d-162) then
tmp = 2.0d0 * (t_2 - (i * (a * c)))
else if (c <= 4400000000.0d0) then
tmp = 2.0d0 * (t_2 - (i * (c * (b * c))))
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = (z * t) + (x * y);
double t_3 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -4.5e+89) {
tmp = t_3;
} else if (c <= -155000.0) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.8e-162) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} else if (c <= 4400000000.0) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = (z * t) + (x * y) t_3 = 2.0 * ((x * y) - t_1) tmp = 0 if c <= -4.5e+89: tmp = t_3 elif c <= -155000.0: tmp = 2.0 * ((z * t) - t_1) elif c <= 6.8e-162: tmp = 2.0 * (t_2 - (i * (a * c))) elif c <= 4400000000.0: tmp = 2.0 * (t_2 - (i * (c * (b * c)))) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(Float64(z * t) + Float64(x * y)) t_3 = Float64(2.0 * Float64(Float64(x * y) - t_1)) tmp = 0.0 if (c <= -4.5e+89) tmp = t_3; elseif (c <= -155000.0) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 6.8e-162) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(a * c)))); elseif (c <= 4400000000.0) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(c * Float64(b * c))))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = (z * t) + (x * y); t_3 = 2.0 * ((x * y) - t_1); tmp = 0.0; if (c <= -4.5e+89) tmp = t_3; elseif (c <= -155000.0) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 6.8e-162) tmp = 2.0 * (t_2 - (i * (a * c))); elseif (c <= 4400000000.0) tmp = 2.0 * (t_2 - (i * (c * (b * c)))); else tmp = t_3; 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]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.5e+89], t$95$3, If[LessEqual[c, -155000.0], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.8e-162], N[(2.0 * N[(t$95$2 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4400000000.0], N[(2.0 * N[(t$95$2 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := z \cdot t + x \cdot y\\
t_3 := 2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{if}\;c \leq -4.5 \cdot 10^{+89}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -155000:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{elif}\;c \leq 6.8 \cdot 10^{-162}:\\
\;\;\;\;2 \cdot \left(t_2 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 4400000000:\\
\;\;\;\;2 \cdot \left(t_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -4.5e89 or 4.4e9 < c Initial program 82.3%
Taylor expanded in z around 0 93.2%
if -4.5e89 < c < -155000Initial program 85.1%
Taylor expanded in x around 0 99.8%
if -155000 < c < 6.8e-162Initial program 99.9%
Taylor expanded in a around inf 98.7%
if 6.8e-162 < c < 4.4e9Initial program 97.2%
Taylor expanded in a around 0 91.0%
unpow291.0%
associate-*r*91.1%
Simplified91.1%
Final simplification95.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (* 2.0 (- (* x y) t_1))))
(if (<= c -1.35e+82)
t_2
(if (<= c -17000.0)
(* 2.0 (- (* z t) t_1))
(if (<= c 6.2e-65)
(* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))
t_2)))))
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 t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -1.35e+82) {
tmp = t_2;
} else if (c <= -17000.0) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.2e-65) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} 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 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((x * y) - t_1)
if (c <= (-1.35d+82)) then
tmp = t_2
else if (c <= (-17000.0d0)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 6.2d-65) then
tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -1.35e+82) {
tmp = t_2;
} else if (c <= -17000.0) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 6.2e-65) {
tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((x * y) - t_1) tmp = 0 if c <= -1.35e+82: tmp = t_2 elif c <= -17000.0: tmp = 2.0 * ((z * t) - t_1) elif c <= 6.2e-65: tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(2.0 * Float64(Float64(x * y) - t_1)) tmp = 0.0 if (c <= -1.35e+82) tmp = t_2; elseif (c <= -17000.0) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 6.2e-65) tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = 2.0 * ((x * y) - t_1); tmp = 0.0; if (c <= -1.35e+82) tmp = t_2; elseif (c <= -17000.0) tmp = 2.0 * ((z * t) - t_1); elseif (c <= 6.2e-65) tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c))); else tmp = t_2; 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]}, Block[{t$95$2 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.35e+82], t$95$2, If[LessEqual[c, -17000.0], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.2e-65], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{if}\;c \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -17000:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{elif}\;c \leq 6.2 \cdot 10^{-65}:\\
\;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.35e82 or 6.20000000000000032e-65 < c Initial program 83.8%
Taylor expanded in z around 0 90.9%
if -1.35e82 < c < -17000Initial program 85.1%
Taylor expanded in x around 0 99.8%
if -17000 < c < 6.20000000000000032e-65Initial program 100.0%
Taylor expanded in a around inf 95.5%
Final simplification93.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* a i)))))
(t_2 (* 2.0 (* c (* i (* b (- c)))))))
(if (<= c -1.45e+112)
t_2
(if (<= c -3.4e-65)
t_1
(if (<= c 1.95e+17)
(* (+ (* z t) (* x y)) 2.0)
(if (<= c 4.4e+125) 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 * ((z * t) - (c * (a * i)));
double t_2 = 2.0 * (c * (i * (b * -c)));
double tmp;
if (c <= -1.45e+112) {
tmp = t_2;
} else if (c <= -3.4e-65) {
tmp = t_1;
} else if (c <= 1.95e+17) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 4.4e+125) {
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 * ((z * t) - (c * (a * i)))
t_2 = 2.0d0 * (c * (i * (b * -c)))
if (c <= (-1.45d+112)) then
tmp = t_2
else if (c <= (-3.4d-65)) then
tmp = t_1
else if (c <= 1.95d+17) then
tmp = ((z * t) + (x * y)) * 2.0d0
else if (c <= 4.4d+125) 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 * ((z * t) - (c * (a * i)));
double t_2 = 2.0 * (c * (i * (b * -c)));
double tmp;
if (c <= -1.45e+112) {
tmp = t_2;
} else if (c <= -3.4e-65) {
tmp = t_1;
} else if (c <= 1.95e+17) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 4.4e+125) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * (a * i))) t_2 = 2.0 * (c * (i * (b * -c))) tmp = 0 if c <= -1.45e+112: tmp = t_2 elif c <= -3.4e-65: tmp = t_1 elif c <= 1.95e+17: tmp = ((z * t) + (x * y)) * 2.0 elif c <= 4.4e+125: 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(Float64(z * t) - Float64(c * Float64(a * i)))) t_2 = Float64(2.0 * Float64(c * Float64(i * Float64(b * Float64(-c))))) tmp = 0.0 if (c <= -1.45e+112) tmp = t_2; elseif (c <= -3.4e-65) tmp = t_1; elseif (c <= 1.95e+17) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); elseif (c <= 4.4e+125) 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 * ((z * t) - (c * (a * i))); t_2 = 2.0 * (c * (i * (b * -c))); tmp = 0.0; if (c <= -1.45e+112) tmp = t_2; elseif (c <= -3.4e-65) tmp = t_1; elseif (c <= 1.95e+17) tmp = ((z * t) + (x * y)) * 2.0; elseif (c <= 4.4e+125) 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[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(i * N[(b * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.45e+112], t$95$2, If[LessEqual[c, -3.4e-65], t$95$1, If[LessEqual[c, 1.95e+17], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 4.4e+125], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\
\mathbf{if}\;c \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -3.4 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+17}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 4.4 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -1.4500000000000001e112 or 4.39999999999999982e125 < c Initial program 81.4%
Taylor expanded in a around 0 72.5%
unpow272.5%
Simplified72.5%
Taylor expanded in c around inf 70.0%
mul-1-neg70.0%
*-commutative70.0%
unpow270.0%
associate-*l*71.2%
associate-*l*75.3%
*-commutative75.3%
distribute-rgt-neg-in75.3%
distribute-rgt-neg-in75.3%
*-commutative75.3%
distribute-rgt-neg-in75.3%
Simplified75.3%
if -1.4500000000000001e112 < c < -3.39999999999999987e-65 or 1.95e17 < c < 4.39999999999999982e125Initial program 88.8%
Taylor expanded in a around inf 71.6%
Taylor expanded in x around 0 67.1%
if -3.39999999999999987e-65 < c < 1.95e17Initial program 99.1%
Taylor expanded in c around 0 80.1%
Final simplification75.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -1.6e-47)
t_1
(if (<= c 6300000.0)
(* (+ (* z t) (* x y)) 2.0)
(if (<= c 1.8e+120) t_1 (* 2.0 (- (* x y) (* c (* b (* c i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.6e-47) {
tmp = t_1;
} else if (c <= 6300000.0) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 1.8e+120) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) - (c * (b * (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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-1.6d-47)) then
tmp = t_1
else if (c <= 6300000.0d0) then
tmp = ((z * t) + (x * y)) * 2.0d0
else if (c <= 1.8d+120) then
tmp = t_1
else
tmp = 2.0d0 * ((x * y) - (c * (b * (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 t_1 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -1.6e-47) {
tmp = t_1;
} else if (c <= 6300000.0) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 1.8e+120) {
tmp = t_1;
} else {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -1.6e-47: tmp = t_1 elif c <= 6300000.0: tmp = ((z * t) + (x * y)) * 2.0 elif c <= 1.8e+120: tmp = t_1 else: tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -1.6e-47) tmp = t_1; elseif (c <= 6300000.0) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); elseif (c <= 1.8e+120) tmp = t_1; else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -1.6e-47) tmp = t_1; elseif (c <= 6300000.0) tmp = ((z * t) + (x * y)) * 2.0; elseif (c <= 1.8e+120) tmp = t_1; else tmp = 2.0 * ((x * y) - (c * (b * (c * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.6e-47], t$95$1, If[LessEqual[c, 6300000.0], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 1.8e+120], t$95$1, N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -1.6 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 6300000:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -1.6e-47 or 6.3e6 < c < 1.80000000000000008e120Initial program 88.0%
Taylor expanded in i around inf 79.0%
if -1.6e-47 < c < 6.3e6Initial program 99.1%
Taylor expanded in c around 0 81.0%
if 1.80000000000000008e120 < c Initial program 75.8%
Taylor expanded in a around 0 69.4%
unpow269.4%
Simplified69.4%
Taylor expanded in z around 0 73.4%
*-commutative73.4%
unpow273.4%
associate-*l*86.6%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
Simplified88.7%
Final simplification81.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= x -6.2e+139)
(* 2.0 (- (* x y) t_1))
(if (<= x 7.5e-35)
(* 2.0 (- (* z t) t_1))
(* 2.0 (- (* x y) (* b (* i (* c c)))))))))
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 (x <= -6.2e+139) {
tmp = 2.0 * ((x * y) - t_1);
} else if (x <= 7.5e-35) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - (b * (i * (c * c))));
}
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 (x <= (-6.2d+139)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (x <= 7.5d-35) then
tmp = 2.0d0 * ((z * t) - t_1)
else
tmp = 2.0d0 * ((x * y) - (b * (i * (c * 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 i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (x <= -6.2e+139) {
tmp = 2.0 * ((x * y) - t_1);
} else if (x <= 7.5e-35) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - (b * (i * (c * c))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if x <= -6.2e+139: tmp = 2.0 * ((x * y) - t_1) elif x <= 7.5e-35: tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * ((x * y) - (b * (i * (c * c)))) 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 (x <= -6.2e+139) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (x <= 7.5e-35) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(b * Float64(i * Float64(c * c))))); 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 (x <= -6.2e+139) tmp = 2.0 * ((x * y) - t_1); elseif (x <= 7.5e-35) tmp = 2.0 * ((z * t) - t_1); else tmp = 2.0 * ((x * y) - (b * (i * (c * c)))); 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[x, -6.2e+139], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-35], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+139}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if x < -6.2e139Initial program 89.1%
Taylor expanded in z around 0 76.7%
if -6.2e139 < x < 7.5e-35Initial program 92.9%
Taylor expanded in x around 0 82.6%
if 7.5e-35 < x Initial program 88.1%
Taylor expanded in a around 0 80.2%
unpow280.2%
Simplified80.2%
associate--l+80.2%
*-commutative80.2%
fma-def81.6%
associate-*l*84.0%
Applied egg-rr84.0%
Taylor expanded in z around 0 69.6%
unpow269.6%
associate-*r*72.3%
associate-*r*74.9%
associate-*r*73.6%
*-commutative73.6%
associate-*l*73.6%
*-commutative73.6%
associate-*r*74.9%
associate-*r*72.3%
Simplified72.3%
Final simplification78.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* i (* b (- c)))))))
(if (<= c -1.65e+37)
t_1
(if (<= c 1.3e+16)
(* (+ (* z t) (* x y)) 2.0)
(if (<= c 7.6e+121)
(* (* a i) (* c -2.0))
(if (<= c 2.2e+142) (* 2.0 (* x y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (c * (i * (b * -c)));
double tmp;
if (c <= -1.65e+37) {
tmp = t_1;
} else if (c <= 1.3e+16) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 7.6e+121) {
tmp = (a * i) * (c * -2.0);
} else if (c <= 2.2e+142) {
tmp = 2.0 * (x * y);
} 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 = 2.0d0 * (c * (i * (b * -c)))
if (c <= (-1.65d+37)) then
tmp = t_1
else if (c <= 1.3d+16) then
tmp = ((z * t) + (x * y)) * 2.0d0
else if (c <= 7.6d+121) then
tmp = (a * i) * (c * (-2.0d0))
else if (c <= 2.2d+142) then
tmp = 2.0d0 * (x * y)
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 = 2.0 * (c * (i * (b * -c)));
double tmp;
if (c <= -1.65e+37) {
tmp = t_1;
} else if (c <= 1.3e+16) {
tmp = ((z * t) + (x * y)) * 2.0;
} else if (c <= 7.6e+121) {
tmp = (a * i) * (c * -2.0);
} else if (c <= 2.2e+142) {
tmp = 2.0 * (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * (i * (b * -c))) tmp = 0 if c <= -1.65e+37: tmp = t_1 elif c <= 1.3e+16: tmp = ((z * t) + (x * y)) * 2.0 elif c <= 7.6e+121: tmp = (a * i) * (c * -2.0) elif c <= 2.2e+142: tmp = 2.0 * (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(i * Float64(b * Float64(-c))))) tmp = 0.0 if (c <= -1.65e+37) tmp = t_1; elseif (c <= 1.3e+16) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); elseif (c <= 7.6e+121) tmp = Float64(Float64(a * i) * Float64(c * -2.0)); elseif (c <= 2.2e+142) tmp = Float64(2.0 * Float64(x * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * (i * (b * -c))); tmp = 0.0; if (c <= -1.65e+37) tmp = t_1; elseif (c <= 1.3e+16) tmp = ((z * t) + (x * y)) * 2.0; elseif (c <= 7.6e+121) tmp = (a * i) * (c * -2.0); elseif (c <= 2.2e+142) tmp = 2.0 * (x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(i * N[(b * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.65e+37], t$95$1, If[LessEqual[c, 1.3e+16], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 7.6e+121], N[(N[(a * i), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e+142], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\
\mathbf{if}\;c \leq -1.65 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.3 \cdot 10^{+16}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{+121}:\\
\;\;\;\;\left(a \cdot i\right) \cdot \left(c \cdot -2\right)\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+142}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -1.65e37 or 2.19999999999999987e142 < c Initial program 81.9%
Taylor expanded in a around 0 73.2%
unpow273.2%
Simplified73.2%
Taylor expanded in c around inf 68.0%
mul-1-neg68.0%
*-commutative68.0%
unpow268.0%
associate-*l*69.1%
associate-*l*72.6%
*-commutative72.6%
distribute-rgt-neg-in72.6%
distribute-rgt-neg-in72.6%
*-commutative72.6%
distribute-rgt-neg-in72.6%
Simplified72.6%
if -1.65e37 < c < 1.3e16Initial program 98.6%
Taylor expanded in c around 0 75.7%
if 1.3e16 < c < 7.6e121Initial program 82.7%
associate-*r*99.8%
*-commutative99.8%
+-commutative99.8%
distribute-lft-in81.1%
Applied egg-rr81.1%
Taylor expanded in a around inf 63.0%
mul-1-neg63.0%
*-commutative63.0%
*-commutative63.0%
distribute-rgt-neg-in63.0%
associate-*l*63.0%
Simplified63.0%
Taylor expanded in a around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*l*63.0%
Simplified63.0%
if 7.6e121 < c < 2.19999999999999987e142Initial program 100.0%
Taylor expanded in x around inf 100.0%
Final simplification73.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.9e-47) (not (<= c 16000000.0))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.9e-47) || !(c <= 16000000.0)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((z * t) + (x * y)) * 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 <= (-1.9d-47)) .or. (.not. (c <= 16000000.0d0))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = ((z * t) + (x * y)) * 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 <= -1.9e-47) || !(c <= 16000000.0)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = ((z * t) + (x * y)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.9e-47) or not (c <= 16000000.0): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = ((z * t) + (x * y)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.9e-47) || !(c <= 16000000.0)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.9e-47) || ~((c <= 16000000.0))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = ((z * t) + (x * y)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.9e-47], N[Not[LessEqual[c, 16000000.0]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.9 \cdot 10^{-47} \lor \neg \left(c \leq 16000000\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.90000000000000007e-47 or 1.6e7 < c Initial program 84.1%
Taylor expanded in i around inf 77.2%
if -1.90000000000000007e-47 < c < 1.6e7Initial program 99.1%
Taylor expanded in c around 0 81.0%
Final simplification78.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= y -1.12e-23)
t_1
(if (<= y -5.8e-217)
(* 2.0 (* a (* c (- i))))
(if (<= y 2.05e+48) (* 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -1.12e-23) {
tmp = t_1;
} else if (y <= -5.8e-217) {
tmp = 2.0 * (a * (c * -i));
} else if (y <= 2.05e+48) {
tmp = 2.0 * (z * t);
} 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 = 2.0d0 * (x * y)
if (y <= (-1.12d-23)) then
tmp = t_1
else if (y <= (-5.8d-217)) then
tmp = 2.0d0 * (a * (c * -i))
else if (y <= 2.05d+48) then
tmp = 2.0d0 * (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -1.12e-23) {
tmp = t_1;
} else if (y <= -5.8e-217) {
tmp = 2.0 * (a * (c * -i));
} else if (y <= 2.05e+48) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if y <= -1.12e-23: tmp = t_1 elif y <= -5.8e-217: tmp = 2.0 * (a * (c * -i)) elif y <= 2.05e+48: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -1.12e-23) tmp = t_1; elseif (y <= -5.8e-217) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); elseif (y <= 2.05e+48) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if (y <= -1.12e-23) tmp = t_1; elseif (y <= -5.8e-217) tmp = 2.0 * (a * (c * -i)); elseif (y <= 2.05e+48) tmp = 2.0 * (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.12e-23], t$95$1, If[LessEqual[y, -5.8e-217], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e+48], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-217}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.1200000000000001e-23 or 2.0500000000000001e48 < y Initial program 90.8%
Taylor expanded in x around inf 45.0%
if -1.1200000000000001e-23 < y < -5.79999999999999963e-217Initial program 85.6%
associate-*r*96.8%
*-commutative96.8%
+-commutative96.8%
distribute-lft-in84.7%
Applied egg-rr84.7%
Taylor expanded in a around inf 34.2%
mul-1-neg34.2%
*-commutative34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
associate-*l*31.3%
Simplified31.3%
if -5.79999999999999963e-217 < y < 2.0500000000000001e48Initial program 93.2%
Taylor expanded in z around inf 37.4%
Final simplification40.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= y -3.1e-118)
t_1
(if (<= y -3.2e-214)
(* (* a i) (* c -2.0))
(if (<= y 5.1e+52) (* 2.0 (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -3.1e-118) {
tmp = t_1;
} else if (y <= -3.2e-214) {
tmp = (a * i) * (c * -2.0);
} else if (y <= 5.1e+52) {
tmp = 2.0 * (z * t);
} 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 = 2.0d0 * (x * y)
if (y <= (-3.1d-118)) then
tmp = t_1
else if (y <= (-3.2d-214)) then
tmp = (a * i) * (c * (-2.0d0))
else if (y <= 5.1d+52) then
tmp = 2.0d0 * (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if (y <= -3.1e-118) {
tmp = t_1;
} else if (y <= -3.2e-214) {
tmp = (a * i) * (c * -2.0);
} else if (y <= 5.1e+52) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if y <= -3.1e-118: tmp = t_1 elif y <= -3.2e-214: tmp = (a * i) * (c * -2.0) elif y <= 5.1e+52: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (y <= -3.1e-118) tmp = t_1; elseif (y <= -3.2e-214) tmp = Float64(Float64(a * i) * Float64(c * -2.0)); elseif (y <= 5.1e+52) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if (y <= -3.1e-118) tmp = t_1; elseif (y <= -3.2e-214) tmp = (a * i) * (c * -2.0); elseif (y <= 5.1e+52) tmp = 2.0 * (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-118], t$95$1, If[LessEqual[y, -3.2e-214], N[(N[(a * i), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+52], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-118}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-214}:\\
\;\;\;\;\left(a \cdot i\right) \cdot \left(c \cdot -2\right)\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.1000000000000001e-118 or 5.09999999999999997e52 < y Initial program 91.0%
Taylor expanded in x around inf 41.4%
if -3.1000000000000001e-118 < y < -3.20000000000000013e-214Initial program 80.0%
associate-*r*94.6%
*-commutative94.6%
+-commutative94.6%
distribute-lft-in94.6%
Applied egg-rr94.6%
Taylor expanded in a around inf 37.4%
mul-1-neg37.4%
*-commutative37.4%
*-commutative37.4%
distribute-rgt-neg-in37.4%
associate-*l*32.5%
Simplified32.5%
Taylor expanded in a around 0 37.4%
*-commutative37.4%
*-commutative37.4%
associate-*l*37.4%
Simplified37.4%
if -3.20000000000000013e-214 < y < 5.09999999999999997e52Initial program 93.2%
Taylor expanded in z around inf 37.4%
Final simplification39.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 4.6e+150) (* (+ (* z t) (* x y)) 2.0) (* (* a i) (* c -2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 4.6e+150) {
tmp = ((z * t) + (x * y)) * 2.0;
} else {
tmp = (a * i) * (c * -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 (a <= 4.6d+150) then
tmp = ((z * t) + (x * y)) * 2.0d0
else
tmp = (a * i) * (c * (-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 (a <= 4.6e+150) {
tmp = ((z * t) + (x * y)) * 2.0;
} else {
tmp = (a * i) * (c * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 4.6e+150: tmp = ((z * t) + (x * y)) * 2.0 else: tmp = (a * i) * (c * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 4.6e+150) tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0); else tmp = Float64(Float64(a * i) * Float64(c * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= 4.6e+150) tmp = ((z * t) + (x * y)) * 2.0; else tmp = (a * i) * (c * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 4.6e+150], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(a * i), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.6 \cdot 10^{+150}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot i\right) \cdot \left(c \cdot -2\right)\\
\end{array}
\end{array}
if a < 4.60000000000000002e150Initial program 91.6%
Taylor expanded in c around 0 54.6%
if 4.60000000000000002e150 < a Initial program 85.7%
associate-*r*96.4%
*-commutative96.4%
+-commutative96.4%
distribute-lft-in89.0%
Applied egg-rr89.0%
Taylor expanded in a around inf 62.0%
mul-1-neg62.0%
*-commutative62.0%
*-commutative62.0%
distribute-rgt-neg-in62.0%
associate-*l*61.9%
Simplified61.9%
Taylor expanded in a around 0 62.0%
*-commutative62.0%
*-commutative62.0%
associate-*l*62.0%
Simplified62.0%
Final simplification55.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -1.08e-117) (not (<= y 5.6e+50))) (* 2.0 (* x y)) (* 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 ((y <= -1.08e-117) || !(y <= 5.6e+50)) {
tmp = 2.0 * (x * y);
} 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 ((y <= (-1.08d-117)) .or. (.not. (y <= 5.6d+50))) then
tmp = 2.0d0 * (x * y)
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 ((y <= -1.08e-117) || !(y <= 5.6e+50)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -1.08e-117) or not (y <= 5.6e+50): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -1.08e-117) || !(y <= 5.6e+50)) tmp = Float64(2.0 * Float64(x * y)); 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 ((y <= -1.08e-117) || ~((y <= 5.6e+50))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1.08e-117], N[Not[LessEqual[y, 5.6e+50]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{-117} \lor \neg \left(y \leq 5.6 \cdot 10^{+50}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -1.07999999999999998e-117 or 5.5999999999999996e50 < y Initial program 91.0%
Taylor expanded in x around inf 41.4%
if -1.07999999999999998e-117 < y < 5.5999999999999996e50Initial program 91.0%
Taylor expanded in z around inf 37.6%
Final simplification39.7%
(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 91.0%
Taylor expanded in z around inf 27.4%
Final simplification27.4%
(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 2023257
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))