
(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 17 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))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (fma y x (* (- c) (* i (* b 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 t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * fma(y, x, (-c * (i * (b * c))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * fma(y, x, Float64(Float64(-c) * Float64(i * Float64(b * 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]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[((-c) * N[(i * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(i \cdot \left(b \cdot 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*99.5%
fma-def99.5%
Simplified99.5%
fma-def99.5%
+-commutative99.5%
Applied egg-rr99.5%
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 20.0%
unpow220.0%
associate-*r*33.3%
Simplified33.3%
Taylor expanded in z around 0 33.8%
unpow233.8%
*-commutative33.8%
associate-*r*53.8%
associate-*r*47.2%
*-commutative47.2%
*-commutative47.2%
*-commutative47.2%
Simplified47.2%
cancel-sign-sub-inv47.2%
fma-def67.2%
Applied egg-rr67.2%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* -2.0 (* 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 t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (b * (i * (c * c)));
}
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 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = -2.0 * (b * (i * (c * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = -2.0 * (b * (i * (c * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(-2.0 * 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 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = -2.0 * (b * (i * (c * c))); 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot 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*99.5%
fma-def99.5%
Simplified99.5%
fma-def99.5%
+-commutative99.5%
Applied egg-rr99.5%
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 b around inf 47.2%
mul-1-neg47.2%
distribute-rgt-neg-in47.2%
unpow247.2%
Simplified47.2%
Taylor expanded in c around 0 47.2%
associate-*r*66.8%
unpow266.8%
Simplified66.8%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* c (* c (* b i)))))
(t_3 (* 2.0 (* x y))))
(if (<= c -9500.0)
t_2
(if (<= c -2.8e-147)
t_1
(if (<= c -5.6e-193)
t_3
(if (<= c -3.1e-261)
t_1
(if (<= c 1.4e-82)
t_3
(if (<= c 1.2e+20)
t_1
(if (<= c 9e+68)
t_3
(if (<= c 1.35e+211) (* 2.0 (* a (* c (- i)))) 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);
double t_2 = -2.0 * (c * (c * (b * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -9500.0) {
tmp = t_2;
} else if (c <= -2.8e-147) {
tmp = t_1;
} else if (c <= -5.6e-193) {
tmp = t_3;
} else if (c <= -3.1e-261) {
tmp = t_1;
} else if (c <= 1.4e-82) {
tmp = t_3;
} else if (c <= 1.2e+20) {
tmp = t_1;
} else if (c <= 9e+68) {
tmp = t_3;
} else if (c <= 1.35e+211) {
tmp = 2.0 * (a * (c * -i));
} 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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (c * (c * (b * i)))
t_3 = 2.0d0 * (x * y)
if (c <= (-9500.0d0)) then
tmp = t_2
else if (c <= (-2.8d-147)) then
tmp = t_1
else if (c <= (-5.6d-193)) then
tmp = t_3
else if (c <= (-3.1d-261)) then
tmp = t_1
else if (c <= 1.4d-82) then
tmp = t_3
else if (c <= 1.2d+20) then
tmp = t_1
else if (c <= 9d+68) then
tmp = t_3
else if (c <= 1.35d+211) then
tmp = 2.0d0 * (a * (c * -i))
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);
double t_2 = -2.0 * (c * (c * (b * i)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -9500.0) {
tmp = t_2;
} else if (c <= -2.8e-147) {
tmp = t_1;
} else if (c <= -5.6e-193) {
tmp = t_3;
} else if (c <= -3.1e-261) {
tmp = t_1;
} else if (c <= 1.4e-82) {
tmp = t_3;
} else if (c <= 1.2e+20) {
tmp = t_1;
} else if (c <= 9e+68) {
tmp = t_3;
} else if (c <= 1.35e+211) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (c * (c * (b * i))) t_3 = 2.0 * (x * y) tmp = 0 if c <= -9500.0: tmp = t_2 elif c <= -2.8e-147: tmp = t_1 elif c <= -5.6e-193: tmp = t_3 elif c <= -3.1e-261: tmp = t_1 elif c <= 1.4e-82: tmp = t_3 elif c <= 1.2e+20: tmp = t_1 elif c <= 9e+68: tmp = t_3 elif c <= 1.35e+211: tmp = 2.0 * (a * (c * -i)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -9500.0) tmp = t_2; elseif (c <= -2.8e-147) tmp = t_1; elseif (c <= -5.6e-193) tmp = t_3; elseif (c <= -3.1e-261) tmp = t_1; elseif (c <= 1.4e-82) tmp = t_3; elseif (c <= 1.2e+20) tmp = t_1; elseif (c <= 9e+68) tmp = t_3; elseif (c <= 1.35e+211) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); 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); t_2 = -2.0 * (c * (c * (b * i))); t_3 = 2.0 * (x * y); tmp = 0.0; if (c <= -9500.0) tmp = t_2; elseif (c <= -2.8e-147) tmp = t_1; elseif (c <= -5.6e-193) tmp = t_3; elseif (c <= -3.1e-261) tmp = t_1; elseif (c <= 1.4e-82) tmp = t_3; elseif (c <= 1.2e+20) tmp = t_1; elseif (c <= 9e+68) tmp = t_3; elseif (c <= 1.35e+211) tmp = 2.0 * (a * (c * -i)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -9500.0], t$95$2, If[LessEqual[c, -2.8e-147], t$95$1, If[LessEqual[c, -5.6e-193], t$95$3, If[LessEqual[c, -3.1e-261], t$95$1, If[LessEqual[c, 1.4e-82], t$95$3, If[LessEqual[c, 1.2e+20], t$95$1, If[LessEqual[c, 9e+68], t$95$3, If[LessEqual[c, 1.35e+211], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -9500:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.8 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -5.6 \cdot 10^{-193}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -3.1 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.4 \cdot 10^{-82}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 9 \cdot 10^{+68}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.35 \cdot 10^{+211}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -9500 or 1.35e211 < c Initial program 72.0%
Taylor expanded in b around inf 64.5%
mul-1-neg64.5%
distribute-rgt-neg-in64.5%
unpow264.5%
Simplified64.5%
Taylor expanded in c around 0 64.5%
unpow264.5%
*-commutative64.5%
associate-*r*63.4%
associate-*r*66.1%
*-commutative66.1%
associate-*r*67.2%
*-commutative67.2%
associate-*r*63.4%
Simplified63.4%
if -9500 < c < -2.8e-147 or -5.6000000000000005e-193 < c < -3.0999999999999998e-261 or 1.40000000000000012e-82 < c < 1.2e20Initial program 97.1%
Taylor expanded in z around inf 52.2%
if -2.8e-147 < c < -5.6000000000000005e-193 or -3.0999999999999998e-261 < c < 1.40000000000000012e-82 or 1.2e20 < c < 9.0000000000000007e68Initial program 98.7%
Taylor expanded in x around inf 59.1%
if 9.0000000000000007e68 < c < 1.35e211Initial program 79.3%
associate-*l*91.5%
fma-def91.5%
Simplified91.5%
fma-def91.5%
+-commutative91.5%
Applied egg-rr91.5%
Taylor expanded in a around inf 53.2%
mul-1-neg53.2%
associate-*r*57.4%
distribute-lft-neg-in57.4%
distribute-rgt-neg-in57.4%
Simplified57.4%
Final simplification58.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* (* c c) (* b i))))
(t_3 (* 2.0 (* x y))))
(if (<= c -75000.0)
t_2
(if (<= c -9.2e-147)
t_1
(if (<= c -6e-194)
t_3
(if (<= c -4.5e-261)
t_1
(if (<= c 2.6e-87)
t_3
(if (<= c 8.5e+20)
t_1
(if (<= c 1.65e+69)
t_3
(if (<= c 1.46e+168) (* 2.0 (* a (* c (- i)))) 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);
double t_2 = -2.0 * ((c * c) * (b * i));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -75000.0) {
tmp = t_2;
} else if (c <= -9.2e-147) {
tmp = t_1;
} else if (c <= -6e-194) {
tmp = t_3;
} else if (c <= -4.5e-261) {
tmp = t_1;
} else if (c <= 2.6e-87) {
tmp = t_3;
} else if (c <= 8.5e+20) {
tmp = t_1;
} else if (c <= 1.65e+69) {
tmp = t_3;
} else if (c <= 1.46e+168) {
tmp = 2.0 * (a * (c * -i));
} 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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * ((c * c) * (b * i))
t_3 = 2.0d0 * (x * y)
if (c <= (-75000.0d0)) then
tmp = t_2
else if (c <= (-9.2d-147)) then
tmp = t_1
else if (c <= (-6d-194)) then
tmp = t_3
else if (c <= (-4.5d-261)) then
tmp = t_1
else if (c <= 2.6d-87) then
tmp = t_3
else if (c <= 8.5d+20) then
tmp = t_1
else if (c <= 1.65d+69) then
tmp = t_3
else if (c <= 1.46d+168) then
tmp = 2.0d0 * (a * (c * -i))
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);
double t_2 = -2.0 * ((c * c) * (b * i));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -75000.0) {
tmp = t_2;
} else if (c <= -9.2e-147) {
tmp = t_1;
} else if (c <= -6e-194) {
tmp = t_3;
} else if (c <= -4.5e-261) {
tmp = t_1;
} else if (c <= 2.6e-87) {
tmp = t_3;
} else if (c <= 8.5e+20) {
tmp = t_1;
} else if (c <= 1.65e+69) {
tmp = t_3;
} else if (c <= 1.46e+168) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * ((c * c) * (b * i)) t_3 = 2.0 * (x * y) tmp = 0 if c <= -75000.0: tmp = t_2 elif c <= -9.2e-147: tmp = t_1 elif c <= -6e-194: tmp = t_3 elif c <= -4.5e-261: tmp = t_1 elif c <= 2.6e-87: tmp = t_3 elif c <= 8.5e+20: tmp = t_1 elif c <= 1.65e+69: tmp = t_3 elif c <= 1.46e+168: tmp = 2.0 * (a * (c * -i)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(Float64(c * c) * Float64(b * i))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -75000.0) tmp = t_2; elseif (c <= -9.2e-147) tmp = t_1; elseif (c <= -6e-194) tmp = t_3; elseif (c <= -4.5e-261) tmp = t_1; elseif (c <= 2.6e-87) tmp = t_3; elseif (c <= 8.5e+20) tmp = t_1; elseif (c <= 1.65e+69) tmp = t_3; elseif (c <= 1.46e+168) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); 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); t_2 = -2.0 * ((c * c) * (b * i)); t_3 = 2.0 * (x * y); tmp = 0.0; if (c <= -75000.0) tmp = t_2; elseif (c <= -9.2e-147) tmp = t_1; elseif (c <= -6e-194) tmp = t_3; elseif (c <= -4.5e-261) tmp = t_1; elseif (c <= 2.6e-87) tmp = t_3; elseif (c <= 8.5e+20) tmp = t_1; elseif (c <= 1.65e+69) tmp = t_3; elseif (c <= 1.46e+168) tmp = 2.0 * (a * (c * -i)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -75000.0], t$95$2, If[LessEqual[c, -9.2e-147], t$95$1, If[LessEqual[c, -6e-194], t$95$3, If[LessEqual[c, -4.5e-261], t$95$1, If[LessEqual[c, 2.6e-87], t$95$3, If[LessEqual[c, 8.5e+20], t$95$1, If[LessEqual[c, 1.65e+69], t$95$3, If[LessEqual[c, 1.46e+168], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -75000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -9.2 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -6 \cdot 10^{-194}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -4.5 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{-87}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 8.5 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.65 \cdot 10^{+69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.46 \cdot 10^{+168}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -75000 or 1.45999999999999996e168 < c Initial program 73.2%
Taylor expanded in b around inf 64.0%
mul-1-neg64.0%
distribute-rgt-neg-in64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in c around 0 64.0%
unpow264.0%
*-commutative64.0%
associate-*r*60.9%
associate-*r*63.4%
*-commutative63.4%
associate-*r*66.6%
*-commutative66.6%
associate-*r*60.9%
Simplified60.9%
Taylor expanded in c around 0 64.0%
unpow264.0%
*-commutative64.0%
Simplified64.0%
if -75000 < c < -9.19999999999999962e-147 or -6e-194 < c < -4.5000000000000001e-261 or 2.60000000000000002e-87 < c < 8.5e20Initial program 97.1%
Taylor expanded in z around inf 52.2%
if -9.19999999999999962e-147 < c < -6e-194 or -4.5000000000000001e-261 < c < 2.60000000000000002e-87 or 8.5e20 < c < 1.6499999999999999e69Initial program 98.7%
Taylor expanded in x around inf 59.1%
if 1.6499999999999999e69 < c < 1.45999999999999996e168Initial program 76.2%
associate-*l*87.7%
fma-def87.7%
Simplified87.7%
fma-def87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in a around inf 51.4%
mul-1-neg51.4%
associate-*r*57.4%
distribute-lft-neg-in57.4%
distribute-rgt-neg-in57.4%
Simplified57.4%
Final simplification58.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* -2.0 (* b (* i (* c c)))))
(t_3 (* 2.0 (* x y))))
(if (<= c -90000.0)
t_2
(if (<= c -2.8e-147)
t_1
(if (<= c -1.25e-193)
t_3
(if (<= c -3.3e-261)
t_1
(if (<= c 4e-81)
t_3
(if (<= c 1.05e+20)
t_1
(if (<= c 1.8e+68)
t_3
(if (<= c 4.7e+167) (* 2.0 (* a (* c (- i)))) 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);
double t_2 = -2.0 * (b * (i * (c * c)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -90000.0) {
tmp = t_2;
} else if (c <= -2.8e-147) {
tmp = t_1;
} else if (c <= -1.25e-193) {
tmp = t_3;
} else if (c <= -3.3e-261) {
tmp = t_1;
} else if (c <= 4e-81) {
tmp = t_3;
} else if (c <= 1.05e+20) {
tmp = t_1;
} else if (c <= 1.8e+68) {
tmp = t_3;
} else if (c <= 4.7e+167) {
tmp = 2.0 * (a * (c * -i));
} 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) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (-2.0d0) * (b * (i * (c * c)))
t_3 = 2.0d0 * (x * y)
if (c <= (-90000.0d0)) then
tmp = t_2
else if (c <= (-2.8d-147)) then
tmp = t_1
else if (c <= (-1.25d-193)) then
tmp = t_3
else if (c <= (-3.3d-261)) then
tmp = t_1
else if (c <= 4d-81) then
tmp = t_3
else if (c <= 1.05d+20) then
tmp = t_1
else if (c <= 1.8d+68) then
tmp = t_3
else if (c <= 4.7d+167) then
tmp = 2.0d0 * (a * (c * -i))
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);
double t_2 = -2.0 * (b * (i * (c * c)));
double t_3 = 2.0 * (x * y);
double tmp;
if (c <= -90000.0) {
tmp = t_2;
} else if (c <= -2.8e-147) {
tmp = t_1;
} else if (c <= -1.25e-193) {
tmp = t_3;
} else if (c <= -3.3e-261) {
tmp = t_1;
} else if (c <= 4e-81) {
tmp = t_3;
} else if (c <= 1.05e+20) {
tmp = t_1;
} else if (c <= 1.8e+68) {
tmp = t_3;
} else if (c <= 4.7e+167) {
tmp = 2.0 * (a * (c * -i));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = -2.0 * (b * (i * (c * c))) t_3 = 2.0 * (x * y) tmp = 0 if c <= -90000.0: tmp = t_2 elif c <= -2.8e-147: tmp = t_1 elif c <= -1.25e-193: tmp = t_3 elif c <= -3.3e-261: tmp = t_1 elif c <= 4e-81: tmp = t_3 elif c <= 1.05e+20: tmp = t_1 elif c <= 1.8e+68: tmp = t_3 elif c <= 4.7e+167: tmp = 2.0 * (a * (c * -i)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))) t_3 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (c <= -90000.0) tmp = t_2; elseif (c <= -2.8e-147) tmp = t_1; elseif (c <= -1.25e-193) tmp = t_3; elseif (c <= -3.3e-261) tmp = t_1; elseif (c <= 4e-81) tmp = t_3; elseif (c <= 1.05e+20) tmp = t_1; elseif (c <= 1.8e+68) tmp = t_3; elseif (c <= 4.7e+167) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); 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); t_2 = -2.0 * (b * (i * (c * c))); t_3 = 2.0 * (x * y); tmp = 0.0; if (c <= -90000.0) tmp = t_2; elseif (c <= -2.8e-147) tmp = t_1; elseif (c <= -1.25e-193) tmp = t_3; elseif (c <= -3.3e-261) tmp = t_1; elseif (c <= 4e-81) tmp = t_3; elseif (c <= 1.05e+20) tmp = t_1; elseif (c <= 1.8e+68) tmp = t_3; elseif (c <= 4.7e+167) tmp = 2.0 * (a * (c * -i)); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -90000.0], t$95$2, If[LessEqual[c, -2.8e-147], t$95$1, If[LessEqual[c, -1.25e-193], t$95$3, If[LessEqual[c, -3.3e-261], t$95$1, If[LessEqual[c, 4e-81], t$95$3, If[LessEqual[c, 1.05e+20], t$95$1, If[LessEqual[c, 1.8e+68], t$95$3, If[LessEqual[c, 4.7e+167], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -90000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.8 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq -1.25 \cdot 10^{-193}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -3.3 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 4 \cdot 10^{-81}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 1.05 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{+68}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq 4.7 \cdot 10^{+167}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -9e4 or 4.70000000000000013e167 < c Initial program 73.2%
Taylor expanded in b around inf 64.0%
mul-1-neg64.0%
distribute-rgt-neg-in64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in c around 0 64.0%
associate-*r*70.0%
unpow270.0%
Simplified70.0%
if -9e4 < c < -2.8e-147 or -1.2500000000000001e-193 < c < -3.2999999999999998e-261 or 3.9999999999999998e-81 < c < 1.05e20Initial program 97.1%
Taylor expanded in z around inf 52.2%
if -2.8e-147 < c < -1.2500000000000001e-193 or -3.2999999999999998e-261 < c < 3.9999999999999998e-81 or 1.05e20 < c < 1.7999999999999999e68Initial program 98.7%
Taylor expanded in x around inf 59.1%
if 1.7999999999999999e68 < c < 4.70000000000000013e167Initial program 76.2%
associate-*l*87.7%
fma-def87.7%
Simplified87.7%
fma-def87.7%
+-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in a around inf 51.4%
mul-1-neg51.4%
associate-*r*57.4%
distribute-lft-neg-in57.4%
distribute-rgt-neg-in57.4%
Simplified57.4%
Final simplification60.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))))
(if (<= c -3.3e+21)
(* 2.0 (- (* x y) t_2))
(if (<= c 5.5e+127)
(* (- (+ (* x y) (* z t)) (* (* c t_1) i)) 2.0)
(* 2.0 (- (* z t) 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 tmp;
if (c <= -3.3e+21) {
tmp = 2.0 * ((x * y) - t_2);
} else if (c <= 5.5e+127) {
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - 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 = a + (b * c)
t_2 = c * (t_1 * i)
if (c <= (-3.3d+21)) then
tmp = 2.0d0 * ((x * y) - t_2)
else if (c <= 5.5d+127) then
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double tmp;
if (c <= -3.3e+21) {
tmp = 2.0 * ((x * y) - t_2);
} else if (c <= 5.5e+127) {
tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - 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) tmp = 0 if c <= -3.3e+21: tmp = 2.0 * ((x * y) - t_2) elif c <= 5.5e+127: tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0 else: tmp = 2.0 * ((z * t) - 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)) tmp = 0.0 if (c <= -3.3e+21) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (c <= 5.5e+127) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - 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); tmp = 0.0; if (c <= -3.3e+21) tmp = 2.0 * ((x * y) - t_2); elseif (c <= 5.5e+127) tmp = (((x * y) + (z * t)) - ((c * t_1) * i)) * 2.0; else tmp = 2.0 * ((z * t) - 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]}, If[LessEqual[c, -3.3e+21], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.5e+127], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $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)\\
\mathbf{if}\;c \leq -3.3 \cdot 10^{+21}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\
\mathbf{elif}\;c \leq 5.5 \cdot 10^{+127}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\
\end{array}
\end{array}
if c < -3.3e21Initial program 71.3%
Taylor expanded in z around 0 89.7%
if -3.3e21 < c < 5.50000000000000041e127Initial program 97.5%
if 5.50000000000000041e127 < c Initial program 72.7%
Taylor expanded in x around 0 91.3%
Final simplification94.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= c -2e+22)
(* 2.0 (* c (* t_1 (- i))))
(if (<= c 7.2e-96)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* z t) (* c (* t_1 i))))))))
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 (c <= -2e+22) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (c <= 7.2e-96) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * 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 = a + (b * c)
if (c <= (-2d+22)) then
tmp = 2.0d0 * (c * (t_1 * -i))
else if (c <= 7.2d-96) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - (c * (t_1 * 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 = a + (b * c);
double tmp;
if (c <= -2e+22) {
tmp = 2.0 * (c * (t_1 * -i));
} else if (c <= 7.2e-96) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if c <= -2e+22: tmp = 2.0 * (c * (t_1 * -i)) elif c <= 7.2e-96: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - (c * (t_1 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (c <= -2e+22) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); elseif (c <= 7.2e-96) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); tmp = 0.0; if (c <= -2e+22) tmp = 2.0 * (c * (t_1 * -i)); elseif (c <= 7.2e-96) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - (c * (t_1 * i))); 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]}, If[LessEqual[c, -2e+22], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.2e-96], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;c \leq -2 \cdot 10^{+22}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;c \leq 7.2 \cdot 10^{-96}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -2e22Initial program 71.3%
Taylor expanded in i around inf 79.7%
if -2e22 < c < 7.20000000000000016e-96Initial program 98.2%
Taylor expanded in c around 0 84.1%
if 7.20000000000000016e-96 < c Initial program 85.4%
Taylor expanded in x around 0 82.7%
Final simplification82.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -19000000000000.0)
(* 2.0 (- (* x y) t_1))
(if (<= c 3.2e-96) (* 2.0 (+ (* x y) (* z t))) (* 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -19000000000000.0) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3.2e-96) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - 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)
if (c <= (-19000000000000.0d0)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 3.2d-96) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - 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);
double tmp;
if (c <= -19000000000000.0) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 3.2e-96) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -19000000000000.0: tmp = 2.0 * ((x * y) - t_1) elif c <= 3.2e-96: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - t_1) 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 <= -19000000000000.0) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 3.2e-96) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - 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); tmp = 0.0; if (c <= -19000000000000.0) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 3.2e-96) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - t_1); 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, -19000000000000.0], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.2e-96], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $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 -19000000000000:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{-96}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -1.9e13Initial program 71.3%
Taylor expanded in z around 0 89.7%
if -1.9e13 < c < 3.20000000000000012e-96Initial program 98.2%
Taylor expanded in c around 0 84.1%
if 3.20000000000000012e-96 < c Initial program 85.4%
Taylor expanded in x around 0 82.7%
Final simplification85.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -2.06e+71)
(* 2.0 (- (* x y) t_1))
(if (<= c 1.45e+116)
(* 2.0 (- (+ (* x y) (* z t)) (* c (* a i))))
(* 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.06e+71) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 1.45e+116) {
tmp = 2.0 * (((x * y) + (z * t)) - (c * (a * i)));
} else {
tmp = 2.0 * ((z * t) - 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)
if (c <= (-2.06d+71)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 1.45d+116) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (c * (a * i)))
else
tmp = 2.0d0 * ((z * t) - 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);
double tmp;
if (c <= -2.06e+71) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 1.45e+116) {
tmp = 2.0 * (((x * y) + (z * t)) - (c * (a * i)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -2.06e+71: tmp = 2.0 * ((x * y) - t_1) elif c <= 1.45e+116: tmp = 2.0 * (((x * y) + (z * t)) - (c * (a * i))) else: tmp = 2.0 * ((z * t) - t_1) 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.06e+71) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 1.45e+116) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(c * Float64(a * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - 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); tmp = 0.0; if (c <= -2.06e+71) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 1.45e+116) tmp = 2.0 * (((x * y) + (z * t)) - (c * (a * i))); else tmp = 2.0 * ((z * t) - t_1); 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.06e+71], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.45e+116], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $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.06 \cdot 10^{+71}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{+116}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\end{array}
\end{array}
if c < -2.0599999999999999e71Initial program 68.0%
Taylor expanded in z around 0 88.6%
if -2.0599999999999999e71 < c < 1.4500000000000001e116Initial program 97.6%
associate-*l*98.2%
fma-def98.2%
Simplified98.2%
fma-def98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in a around inf 86.8%
*-commutative86.8%
Simplified86.8%
if 1.4500000000000001e116 < c Initial program 72.7%
Taylor expanded in x around 0 91.3%
Final simplification87.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* b (* i (* c c))))))
(if (<= c -1.65e+65)
t_1
(if (<= c 8e-93)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 5.6e+207) (* 2.0 (- (* z t) (* c (* a i)))) 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 * (b * (i * (c * c)));
double tmp;
if (c <= -1.65e+65) {
tmp = t_1;
} else if (c <= 8e-93) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.6e+207) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} 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) * (b * (i * (c * c)))
if (c <= (-1.65d+65)) then
tmp = t_1
else if (c <= 8d-93) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 5.6d+207) then
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
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 * (b * (i * (c * c)));
double tmp;
if (c <= -1.65e+65) {
tmp = t_1;
} else if (c <= 8e-93) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 5.6e+207) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (b * (i * (c * c))) tmp = 0 if c <= -1.65e+65: tmp = t_1 elif c <= 8e-93: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 5.6e+207: tmp = 2.0 * ((z * t) - (c * (a * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))) tmp = 0.0 if (c <= -1.65e+65) tmp = t_1; elseif (c <= 8e-93) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 5.6e+207) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (b * (i * (c * c))); tmp = 0.0; if (c <= -1.65e+65) tmp = t_1; elseif (c <= 8e-93) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 5.6e+207) tmp = 2.0 * ((z * t) - (c * (a * i))); 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[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.65e+65], t$95$1, If[LessEqual[c, 8e-93], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.6e+207], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -1.65 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8 \cdot 10^{-93}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 5.6 \cdot 10^{+207}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -1.65000000000000012e65 or 5.60000000000000022e207 < c Initial program 69.8%
Taylor expanded in b around inf 69.4%
mul-1-neg69.4%
distribute-rgt-neg-in69.4%
unpow269.4%
Simplified69.4%
Taylor expanded in c around 0 69.4%
associate-*r*76.5%
unpow276.5%
Simplified76.5%
if -1.65000000000000012e65 < c < 7.9999999999999992e-93Initial program 98.3%
Taylor expanded in c around 0 81.8%
if 7.9999999999999992e-93 < c < 5.60000000000000022e207Initial program 89.8%
associate-*l*94.7%
fma-def94.7%
Simplified94.7%
fma-def94.7%
+-commutative94.7%
Applied egg-rr94.7%
Taylor expanded in a around inf 76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in x around 0 63.1%
Final simplification76.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.6e+21) (not (<= c 1.05e+81))) (* 2.0 (* c (* (+ a (* b c)) (- i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.6e+21) || !(c <= 1.05e+81)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-1.6d+21)) .or. (.not. (c <= 1.05d+81))) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -1.6e+21) || !(c <= 1.05e+81)) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.6e+21) or not (c <= 1.05e+81): tmp = 2.0 * (c * ((a + (b * c)) * -i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.6e+21) || !(c <= 1.05e+81)) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.6e+21) || ~((c <= 1.05e+81))) tmp = 2.0 * (c * ((a + (b * c)) * -i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.6e+21], N[Not[LessEqual[c, 1.05e+81]], $MachinePrecision]], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.6 \cdot 10^{+21} \lor \neg \left(c \leq 1.05 \cdot 10^{+81}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.6e21 or 1.0499999999999999e81 < c Initial program 72.8%
Taylor expanded in i around inf 79.4%
if -1.6e21 < c < 1.0499999999999999e81Initial program 98.0%
Taylor expanded in c around 0 78.3%
Final simplification78.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= x -3.8e+115)
t_2
(if (<= x -1.42e-64)
t_1
(if (<= x -4.9e-265)
(* 2.0 (* i (* a (- c))))
(if (<= x 1.42e-126) 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);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -3.8e+115) {
tmp = t_2;
} else if (x <= -1.42e-64) {
tmp = t_1;
} else if (x <= -4.9e-265) {
tmp = 2.0 * (i * (a * -c));
} else if (x <= 1.42e-126) {
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)
t_2 = 2.0d0 * (x * y)
if (x <= (-3.8d+115)) then
tmp = t_2
else if (x <= (-1.42d-64)) then
tmp = t_1
else if (x <= (-4.9d-265)) then
tmp = 2.0d0 * (i * (a * -c))
else if (x <= 1.42d-126) 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);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -3.8e+115) {
tmp = t_2;
} else if (x <= -1.42e-64) {
tmp = t_1;
} else if (x <= -4.9e-265) {
tmp = 2.0 * (i * (a * -c));
} else if (x <= 1.42e-126) {
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) t_2 = 2.0 * (x * y) tmp = 0 if x <= -3.8e+115: tmp = t_2 elif x <= -1.42e-64: tmp = t_1 elif x <= -4.9e-265: tmp = 2.0 * (i * (a * -c)) elif x <= 1.42e-126: 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(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (x <= -3.8e+115) tmp = t_2; elseif (x <= -1.42e-64) tmp = t_1; elseif (x <= -4.9e-265) tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c)))); elseif (x <= 1.42e-126) 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); t_2 = 2.0 * (x * y); tmp = 0.0; if (x <= -3.8e+115) tmp = t_2; elseif (x <= -1.42e-64) tmp = t_1; elseif (x <= -4.9e-265) tmp = 2.0 * (i * (a * -c)); elseif (x <= 1.42e-126) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+115], t$95$2, If[LessEqual[x, -1.42e-64], t$95$1, If[LessEqual[x, -4.9e-265], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.42e-126], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+115}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.42 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-265}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.42 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.8000000000000001e115 or 1.42e-126 < x Initial program 87.0%
Taylor expanded in x around inf 46.6%
if -3.8000000000000001e115 < x < -1.42000000000000006e-64 or -4.89999999999999999e-265 < x < 1.42e-126Initial program 87.0%
Taylor expanded in z around inf 36.9%
if -1.42000000000000006e-64 < x < -4.89999999999999999e-265Initial program 93.6%
Taylor expanded in a around inf 35.5%
mul-1-neg35.5%
*-commutative35.5%
associate-*r*39.7%
distribute-lft-neg-in39.7%
Simplified39.7%
Final simplification42.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= x -7.2e+111)
t_2
(if (<= x -9.5e-65)
t_1
(if (<= x -1.12e-265)
(* 2.0 (* a (* c (- i))))
(if (<= x 1.8e-128) 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);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -7.2e+111) {
tmp = t_2;
} else if (x <= -9.5e-65) {
tmp = t_1;
} else if (x <= -1.12e-265) {
tmp = 2.0 * (a * (c * -i));
} else if (x <= 1.8e-128) {
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)
t_2 = 2.0d0 * (x * y)
if (x <= (-7.2d+111)) then
tmp = t_2
else if (x <= (-9.5d-65)) then
tmp = t_1
else if (x <= (-1.12d-265)) then
tmp = 2.0d0 * (a * (c * -i))
else if (x <= 1.8d-128) 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);
double t_2 = 2.0 * (x * y);
double tmp;
if (x <= -7.2e+111) {
tmp = t_2;
} else if (x <= -9.5e-65) {
tmp = t_1;
} else if (x <= -1.12e-265) {
tmp = 2.0 * (a * (c * -i));
} else if (x <= 1.8e-128) {
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) t_2 = 2.0 * (x * y) tmp = 0 if x <= -7.2e+111: tmp = t_2 elif x <= -9.5e-65: tmp = t_1 elif x <= -1.12e-265: tmp = 2.0 * (a * (c * -i)) elif x <= 1.8e-128: 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(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (x <= -7.2e+111) tmp = t_2; elseif (x <= -9.5e-65) tmp = t_1; elseif (x <= -1.12e-265) tmp = Float64(2.0 * Float64(a * Float64(c * Float64(-i)))); elseif (x <= 1.8e-128) 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); t_2 = 2.0 * (x * y); tmp = 0.0; if (x <= -7.2e+111) tmp = t_2; elseif (x <= -9.5e-65) tmp = t_1; elseif (x <= -1.12e-265) tmp = 2.0 * (a * (c * -i)); elseif (x <= 1.8e-128) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.2e+111], t$95$2, If[LessEqual[x, -9.5e-65], t$95$1, If[LessEqual[x, -1.12e-265], N[(2.0 * N[(a * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-128], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+111}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-265}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -7.2000000000000004e111 or 1.80000000000000012e-128 < x Initial program 87.0%
Taylor expanded in x around inf 46.6%
if -7.2000000000000004e111 < x < -9.5000000000000004e-65 or -1.12e-265 < x < 1.80000000000000012e-128Initial program 87.0%
Taylor expanded in z around inf 36.9%
if -9.5000000000000004e-65 < x < -1.12e-265Initial program 93.6%
associate-*l*97.8%
fma-def97.8%
Simplified97.8%
fma-def97.8%
+-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in a around inf 35.5%
mul-1-neg35.5%
associate-*r*43.9%
distribute-lft-neg-in43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Final simplification43.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -2.75e+72)
(* -2.0 (* b (* i (* c c))))
(if (<= c 9.5e+126)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (* c (* (* c i) (- b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.75e+72) {
tmp = -2.0 * (b * (i * (c * c)));
} else if (c <= 9.5e+126) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * (c * ((c * i) * -b));
}
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 <= (-2.75d+72)) then
tmp = (-2.0d0) * (b * (i * (c * c)))
else if (c <= 9.5d+126) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * (c * ((c * i) * -b))
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 <= -2.75e+72) {
tmp = -2.0 * (b * (i * (c * c)));
} else if (c <= 9.5e+126) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * (c * ((c * i) * -b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.75e+72: tmp = -2.0 * (b * (i * (c * c))) elif c <= 9.5e+126: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * (c * ((c * i) * -b)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.75e+72) tmp = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))); elseif (c <= 9.5e+126) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(c * Float64(Float64(c * i) * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -2.75e+72) tmp = -2.0 * (b * (i * (c * c))); elseif (c <= 9.5e+126) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * (c * ((c * i) * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.75e+72], N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.5e+126], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(N[(c * i), $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.75 \cdot 10^{+72}:\\
\;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 9.5 \cdot 10^{+126}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(c \cdot i\right) \cdot \left(-b\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.75e72Initial program 68.0%
Taylor expanded in b around inf 71.5%
mul-1-neg71.5%
distribute-rgt-neg-in71.5%
unpow271.5%
Simplified71.5%
Taylor expanded in c around 0 71.5%
associate-*r*79.3%
unpow279.3%
Simplified79.3%
if -2.75e72 < c < 9.49999999999999951e126Initial program 97.6%
Taylor expanded in c around 0 74.8%
if 9.49999999999999951e126 < c Initial program 72.7%
associate-*l*88.5%
fma-def88.5%
Simplified88.5%
fma-def88.5%
+-commutative88.5%
Applied egg-rr88.5%
Taylor expanded in b around inf 58.2%
mul-1-neg58.2%
unpow258.2%
*-commutative58.2%
associate-*r*55.5%
distribute-rgt-neg-in55.5%
associate-*r*58.8%
*-commutative58.8%
associate-*l*64.1%
Simplified64.1%
Final simplification74.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7.5e+70) (not (<= c 5.5e+118))) (* -2.0 (* b (* i (* c c)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -7.5e+70) || !(c <= 5.5e+118)) {
tmp = -2.0 * (b * (i * (c * c)));
} else {
tmp = 2.0 * ((x * y) + (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 ((c <= (-7.5d+70)) .or. (.not. (c <= 5.5d+118))) then
tmp = (-2.0d0) * (b * (i * (c * c)))
else
tmp = 2.0d0 * ((x * y) + (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 ((c <= -7.5e+70) || !(c <= 5.5e+118)) {
tmp = -2.0 * (b * (i * (c * c)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -7.5e+70) or not (c <= 5.5e+118): tmp = -2.0 * (b * (i * (c * c))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -7.5e+70) || !(c <= 5.5e+118)) tmp = Float64(-2.0 * Float64(b * Float64(i * Float64(c * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -7.5e+70) || ~((c <= 5.5e+118))) tmp = -2.0 * (b * (i * (c * c))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -7.5e+70], N[Not[LessEqual[c, 5.5e+118]], $MachinePrecision]], N[(-2.0 * N[(b * N[(i * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.5 \cdot 10^{+70} \lor \neg \left(c \leq 5.5 \cdot 10^{+118}\right):\\
\;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -7.50000000000000031e70 or 5.5000000000000003e118 < c Initial program 69.9%
Taylor expanded in b around inf 66.2%
mul-1-neg66.2%
distribute-rgt-neg-in66.2%
unpow266.2%
Simplified66.2%
Taylor expanded in c around 0 66.2%
associate-*r*72.2%
unpow272.2%
Simplified72.2%
if -7.50000000000000031e70 < c < 5.5000000000000003e118Initial program 97.6%
Taylor expanded in c around 0 74.8%
Final simplification73.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -8.8e+111) (not (<= x 1.42e-126))) (* 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 ((x <= -8.8e+111) || !(x <= 1.42e-126)) {
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 ((x <= (-8.8d+111)) .or. (.not. (x <= 1.42d-126))) 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 ((x <= -8.8e+111) || !(x <= 1.42e-126)) {
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 (x <= -8.8e+111) or not (x <= 1.42e-126): 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 ((x <= -8.8e+111) || !(x <= 1.42e-126)) 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 ((x <= -8.8e+111) || ~((x <= 1.42e-126))) 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[x, -8.8e+111], N[Not[LessEqual[x, 1.42e-126]], $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}\;x \leq -8.8 \cdot 10^{+111} \lor \neg \left(x \leq 1.42 \cdot 10^{-126}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if x < -8.79999999999999994e111 or 1.42e-126 < x Initial program 87.0%
Taylor expanded in x around inf 46.6%
if -8.79999999999999994e111 < x < 1.42e-126Initial program 89.5%
Taylor expanded in z around inf 35.0%
Final simplification41.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 88.2%
Taylor expanded in z around inf 28.7%
Final simplification28.7%
(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 2023266
(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))))