
(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 14 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 (* 2.0 (fma (fma b c a) (- (* c i)) (fma z t (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * fma(fma(b, c, a), -(c * i), fma(z, t, (x * y)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * fma(fma(b, c, a), Float64(-Float64(c * i)), fma(z, t, Float64(x * y)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(b * c + a), $MachinePrecision] * (-N[(c * i), $MachinePrecision]) + N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), -c \cdot i, \mathsf{fma}\left(z, t, x \cdot y\right)\right)
\end{array}
Initial program 88.2%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied egg-rr95.8%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (<= t_1 -1e+238)
(* c (* i (* (fma b c a) -2.0)))
(if (<= t_1 -2e+53)
(* 2.0 (fma a (- (* c i)) (* x y)))
(if (<= t_1 2e+95)
(* 2.0 (fma t z (* x y)))
(* 2.0 (- (* z t) (* c (* (fma b c a) i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (a + (b * c));
double tmp;
if (t_1 <= -1e+238) {
tmp = c * (i * (fma(b, c, a) * -2.0));
} else if (t_1 <= -2e+53) {
tmp = 2.0 * fma(a, -(c * i), (x * y));
} else if (t_1 <= 2e+95) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = 2.0 * ((z * t) - (c * (fma(b, c, a) * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_1 <= -1e+238) tmp = Float64(c * Float64(i * Float64(fma(b, c, a) * -2.0))); elseif (t_1 <= -2e+53) tmp = Float64(2.0 * fma(a, Float64(-Float64(c * i)), Float64(x * y))); elseif (t_1 <= 2e+95) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(fma(b, c, a) * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+238], N[(c * N[(i * N[(N[(b * c + a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+53], N[(2.0 * N[(a * (-N[(c * i), $MachinePrecision]) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+95], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+238}:\\
\;\;\;\;c \cdot \left(i \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot -2\right)\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(a, -c \cdot i, x \cdot y\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1e238Initial program 74.9%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6486.2
Simplified86.2%
if -1e238 < (*.f64 (+.f64 a (*.f64 b c)) c) < -2e53Initial program 94.7%
Taylor expanded in x around inf
lower-*.f6489.5
Simplified89.5%
Taylor expanded in b around 0
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6484.6
Simplified84.6%
if -2e53 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000004e95Initial program 96.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6487.6
Simplified87.6%
if 2.00000000000000004e95 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 80.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6484.5
Simplified84.5%
Final simplification86.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (* (fma b c a) -2.0)))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 -1e+238)
t_1
(if (<= t_2 -2e+53)
(* 2.0 (fma a (- (* c i)) (* x y)))
(if (<= t_2 2e+95) (* 2.0 (fma t z (* 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 = c * (i * (fma(b, c, a) * -2.0));
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= -1e+238) {
tmp = t_1;
} else if (t_2 <= -2e+53) {
tmp = 2.0 * fma(a, -(c * i), (x * y));
} else if (t_2 <= 2e+95) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(fma(b, c, a) * -2.0))) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= -1e+238) tmp = t_1; elseif (t_2 <= -2e+53) tmp = Float64(2.0 * fma(a, Float64(-Float64(c * i)), Float64(x * y))); elseif (t_2 <= 2e+95) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(N[(b * c + a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+238], t$95$1, If[LessEqual[t$95$2, -2e+53], N[(2.0 * N[(a * (-N[(c * i), $MachinePrecision]) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+95], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot -2\right)\right)\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+238}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(a, -c \cdot i, x \cdot y\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1e238 or 2.00000000000000004e95 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 78.5%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6476.8
Simplified76.8%
if -1e238 < (*.f64 (+.f64 a (*.f64 b c)) c) < -2e53Initial program 94.7%
Taylor expanded in x around inf
lower-*.f6489.5
Simplified89.5%
Taylor expanded in b around 0
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6484.6
Simplified84.6%
if -2e53 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000004e95Initial program 96.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6487.6
Simplified87.6%
Final simplification82.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i (* (fma b c a) -2.0)))) (t_2 (* i (* c (+ a (* b c))))))
(if (<= t_2 -2e+218)
t_1
(if (<= t_2 2e+166) (* 2.0 (fma t z (* 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 = c * (i * (fma(b, c, a) * -2.0));
double t_2 = i * (c * (a + (b * c)));
double tmp;
if (t_2 <= -2e+218) {
tmp = t_1;
} else if (t_2 <= 2e+166) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * Float64(fma(b, c, a) * -2.0))) t_2 = Float64(i * Float64(c * Float64(a + Float64(b * c)))) tmp = 0.0 if (t_2 <= -2e+218) tmp = t_1; elseif (t_2 <= 2e+166) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * N[(N[(b * c + a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+218], t$95$1, If[LessEqual[t$95$2, 2e+166], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot -2\right)\right)\\
t_2 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+166}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000017e218 or 1.99999999999999988e166 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.0%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6479.5
Simplified79.5%
if -2.00000000000000017e218 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999988e166Initial program 97.8%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6481.9
Simplified81.9%
Final simplification80.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* c (+ a (* b c))))))
(if (<= t_1 -2e+218)
(* c (* (* b i) (* c -2.0)))
(if (<= t_1 1e+263)
(* 2.0 (fma t z (* x y)))
(* (* c (* c i)) (* b -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (c * (a + (b * c)));
double tmp;
if (t_1 <= -2e+218) {
tmp = c * ((b * i) * (c * -2.0));
} else if (t_1 <= 1e+263) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = (c * (c * i)) * (b * -2.0);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(c * Float64(a + Float64(b * c)))) tmp = 0.0 if (t_1 <= -2e+218) tmp = Float64(c * Float64(Float64(b * i) * Float64(c * -2.0))); elseif (t_1 <= 1e+263) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(Float64(c * Float64(c * i)) * Float64(b * -2.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+218], N[(c * N[(N[(b * i), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+263], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+218}:\\
\;\;\;\;c \cdot \left(\left(b \cdot i\right) \cdot \left(c \cdot -2\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+263}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(c \cdot i\right)\right) \cdot \left(b \cdot -2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000017e218Initial program 75.1%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.0
Simplified53.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.7
Applied egg-rr57.7%
if -2.00000000000000017e218 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000002e263Initial program 97.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6479.4
Simplified79.4%
if 1.00000000000000002e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.4%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied egg-rr89.5%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.1
Simplified72.1%
Final simplification73.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (fma b c a) i))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 -1e+41)
(* 2.0 (- (* x y) t_1))
(if (<= t_2 2e+95) (* 2.0 (fma t z (* x y))) (* 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 * (fma(b, c, a) * i);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= -1e+41) {
tmp = 2.0 * ((x * y) - t_1);
} else if (t_2 <= 2e+95) {
tmp = 2.0 * fma(t, z, (x * y));
} 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(fma(b, c, a) * i)) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= -1e+41) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (t_2 <= 2e+95) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+41], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+95], N[(2.0 * N[(t * z + N[(x * y), $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(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+41}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000001e41Initial program 80.3%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6481.6
Simplified81.6%
if -1.00000000000000001e41 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000004e95Initial program 97.4%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6488.6
Simplified88.6%
if 2.00000000000000004e95 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 80.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6484.5
Simplified84.5%
Final simplification85.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* c (* i -2.0)))) (t_2 (* i (* c (+ a (* b c))))))
(if (<= t_2 -1e+237)
t_1
(if (<= t_2 1e+263) (* 2.0 (fma t z (* 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 = a * (c * (i * -2.0));
double t_2 = i * (c * (a + (b * c)));
double tmp;
if (t_2 <= -1e+237) {
tmp = t_1;
} else if (t_2 <= 1e+263) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a * Float64(c * Float64(i * -2.0))) t_2 = Float64(i * Float64(c * Float64(a + Float64(b * c)))) tmp = 0.0 if (t_2 <= -1e+237) tmp = t_1; elseif (t_2 <= 1e+263) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(c * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+237], t$95$1, If[LessEqual[t$95$2, 1e+263], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot \left(i \cdot -2\right)\right)\\
t_2 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+263}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.9999999999999994e236 or 1.00000000000000002e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.7%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied egg-rr91.6%
Taylor expanded in a around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6448.6
Simplified48.6%
if -9.9999999999999994e236 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000002e263Initial program 97.9%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6478.9
Simplified78.9%
Final simplification66.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* c i)) (* b -2.0))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 -1e+273)
t_1
(if (<= t_2 5e+199) (* 2.0 (fma t z (* 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 = (c * (c * i)) * (b * -2.0);
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= -1e+273) {
tmp = t_1;
} else if (t_2 <= 5e+199) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(c * i)) * Float64(b * -2.0)) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= -1e+273) tmp = t_1; elseif (t_2 <= 5e+199) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+273], t$95$1, If[LessEqual[t$95$2, 5e+199], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(c \cdot i\right)\right) \cdot \left(b \cdot -2\right)\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999945e272 or 4.9999999999999998e199 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 75.1%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied egg-rr90.6%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6468.1
Simplified68.1%
if -9.99999999999999945e272 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999998e199Initial program 95.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6475.9
Simplified75.9%
Final simplification73.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (<= t_1 -1e+273)
(* c (* i (* (* b c) -2.0)))
(if (<= t_1 5e+199)
(* 2.0 (fma t z (* x y)))
(* b (* i (* -2.0 (* 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));
double tmp;
if (t_1 <= -1e+273) {
tmp = c * (i * ((b * c) * -2.0));
} else if (t_1 <= 5e+199) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = b * (i * (-2.0 * (c * c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_1 <= -1e+273) tmp = Float64(c * Float64(i * Float64(Float64(b * c) * -2.0))); elseif (t_1 <= 5e+199) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(b * Float64(i * Float64(-2.0 * Float64(c * c)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+273], N[(c * N[(i * N[(N[(b * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+199], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(i * N[(-2.0 * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+273}:\\
\;\;\;\;c \cdot \left(i \cdot \left(\left(b \cdot c\right) \cdot -2\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(i \cdot \left(-2 \cdot \left(c \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999945e272Initial program 74.8%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6490.0
Simplified90.0%
Taylor expanded in b around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.7
Simplified66.7%
if -9.99999999999999945e272 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999998e199Initial program 95.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6475.9
Simplified75.9%
if 4.9999999999999998e199 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 75.3%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6466.1
Simplified66.1%
Final simplification72.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (* i (* -2.0 (* c c))))) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 -1e+273)
t_1
(if (<= t_2 5e+199) (* 2.0 (fma t z (* 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 = b * (i * (-2.0 * (c * c)));
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= -1e+273) {
tmp = t_1;
} else if (t_2 <= 5e+199) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * Float64(i * Float64(-2.0 * Float64(c * c)))) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= -1e+273) tmp = t_1; elseif (t_2 <= 5e+199) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[(i * N[(-2.0 * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+273], t$95$1, If[LessEqual[t$95$2, 5e+199], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot \left(-2 \cdot \left(c \cdot c\right)\right)\right)\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+199}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -9.99999999999999945e272 or 4.9999999999999998e199 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 75.1%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.3
Simplified65.3%
if -9.99999999999999945e272 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999998e199Initial program 95.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6475.9
Simplified75.9%
Final simplification72.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -4.8e+75)
t_1
(if (<= (* x y) -1.7e-106)
(* a (* c (* i -2.0)))
(if (<= (* x y) 8.2e+122) (* t (* 2.0 z)) 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 ((x * y) <= -4.8e+75) {
tmp = t_1;
} else if ((x * y) <= -1.7e-106) {
tmp = a * (c * (i * -2.0));
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 ((x * y) <= (-4.8d+75)) then
tmp = t_1
else if ((x * y) <= (-1.7d-106)) then
tmp = a * (c * (i * (-2.0d0)))
else if ((x * y) <= 8.2d+122) then
tmp = t * (2.0d0 * z)
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 ((x * y) <= -4.8e+75) {
tmp = t_1;
} else if ((x * y) <= -1.7e-106) {
tmp = a * (c * (i * -2.0));
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 (x * y) <= -4.8e+75: tmp = t_1 elif (x * y) <= -1.7e-106: tmp = a * (c * (i * -2.0)) elif (x * y) <= 8.2e+122: tmp = t * (2.0 * z) 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 (Float64(x * y) <= -4.8e+75) tmp = t_1; elseif (Float64(x * y) <= -1.7e-106) tmp = Float64(a * Float64(c * Float64(i * -2.0))); elseif (Float64(x * y) <= 8.2e+122) tmp = Float64(t * Float64(2.0 * z)); 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 ((x * y) <= -4.8e+75) tmp = t_1; elseif ((x * y) <= -1.7e-106) tmp = a * (c * (i * -2.0)); elseif ((x * y) <= 8.2e+122) tmp = t * (2.0 * z); 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[N[(x * y), $MachinePrecision], -4.8e+75], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-106], N[(a * N[(c * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.2e+122], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-106}:\\
\;\;\;\;a \cdot \left(c \cdot \left(i \cdot -2\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{+122}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.8e75 or 8.2000000000000004e122 < (*.f64 x y) Initial program 85.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6465.0
Simplified65.0%
if -4.8e75 < (*.f64 x y) < -1.69999999999999991e-106Initial program 88.2%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied egg-rr94.2%
Taylor expanded in a around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6434.8
Simplified34.8%
if -1.69999999999999991e-106 < (*.f64 x y) < 8.2000000000000004e122Initial program 91.1%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Simplified43.0%
Final simplification51.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -1.55e+75)
t_1
(if (<= (* x y) -2e-107)
(* -2.0 (* i (* c a)))
(if (<= (* x y) 8.2e+122) (* t (* 2.0 z)) 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 ((x * y) <= -1.55e+75) {
tmp = t_1;
} else if ((x * y) <= -2e-107) {
tmp = -2.0 * (i * (c * a));
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 ((x * y) <= (-1.55d+75)) then
tmp = t_1
else if ((x * y) <= (-2d-107)) then
tmp = (-2.0d0) * (i * (c * a))
else if ((x * y) <= 8.2d+122) then
tmp = t * (2.0d0 * z)
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 ((x * y) <= -1.55e+75) {
tmp = t_1;
} else if ((x * y) <= -2e-107) {
tmp = -2.0 * (i * (c * a));
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 (x * y) <= -1.55e+75: tmp = t_1 elif (x * y) <= -2e-107: tmp = -2.0 * (i * (c * a)) elif (x * y) <= 8.2e+122: tmp = t * (2.0 * z) 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 (Float64(x * y) <= -1.55e+75) tmp = t_1; elseif (Float64(x * y) <= -2e-107) tmp = Float64(-2.0 * Float64(i * Float64(c * a))); elseif (Float64(x * y) <= 8.2e+122) tmp = Float64(t * Float64(2.0 * z)); 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 ((x * y) <= -1.55e+75) tmp = t_1; elseif ((x * y) <= -2e-107) tmp = -2.0 * (i * (c * a)); elseif ((x * y) <= 8.2e+122) tmp = t * (2.0 * z); 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[N[(x * y), $MachinePrecision], -1.55e+75], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-107], N[(-2.0 * N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.2e+122], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-107}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{+122}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.5500000000000001e75 or 8.2000000000000004e122 < (*.f64 x y) Initial program 85.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6465.0
Simplified65.0%
if -1.5500000000000001e75 < (*.f64 x y) < -2e-107Initial program 88.2%
Taylor expanded in x around inf
lower-*.f6478.2
Simplified78.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.3
Simplified78.3%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6434.5
Simplified34.5%
if -2e-107 < (*.f64 x y) < 8.2000000000000004e122Initial program 91.1%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.0
Simplified43.0%
Final simplification51.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -8.8e-55)
t_1
(if (<= (* x y) 8.2e+122) (* t (* 2.0 z)) 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 ((x * y) <= -8.8e-55) {
tmp = t_1;
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 ((x * y) <= (-8.8d-55)) then
tmp = t_1
else if ((x * y) <= 8.2d+122) then
tmp = t * (2.0d0 * z)
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 ((x * y) <= -8.8e-55) {
tmp = t_1;
} else if ((x * y) <= 8.2e+122) {
tmp = t * (2.0 * z);
} 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 (x * y) <= -8.8e-55: tmp = t_1 elif (x * y) <= 8.2e+122: tmp = t * (2.0 * z) 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 (Float64(x * y) <= -8.8e-55) tmp = t_1; elseif (Float64(x * y) <= 8.2e+122) tmp = Float64(t * Float64(2.0 * z)); 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 ((x * y) <= -8.8e-55) tmp = t_1; elseif ((x * y) <= 8.2e+122) tmp = t * (2.0 * z); 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[N[(x * y), $MachinePrecision], -8.8e-55], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e+122], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -8.8 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{+122}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -8.7999999999999998e-55 or 8.2000000000000004e122 < (*.f64 x y) Initial program 85.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.4
Simplified55.4%
if -8.7999999999999998e-55 < (*.f64 x y) < 8.2000000000000004e122Initial program 90.9%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.0
Simplified42.0%
Final simplification48.9%
(FPCore (x y z t a b c i) :precision binary64 (* t (* 2.0 z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
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 = t * (2.0d0 * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
def code(x, y, z, t, a, b, c, i): return t * (2.0 * z)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(2.0 * z)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (2.0 * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(2 \cdot z\right)
\end{array}
Initial program 88.2%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.8
Simplified28.8%
Final simplification28.8%
(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 2024208
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))