
(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 13 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 (* i (- c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) INFINITY)
(* 2.0 (fma (fma b c a) t_1 (fma z t (* x y))))
(* 2.0 (* y (fma t_1 (/ (fma c b a) y) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * -c;
double tmp;
if ((((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * fma(fma(b, c, a), t_1, fma(z, t, (x * y)));
} else {
tmp = 2.0 * (y * fma(t_1, (fma(c, b, a) / y), x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(-c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) <= Inf) tmp = Float64(2.0 * fma(fma(b, c, a), t_1, fma(z, t, Float64(x * y)))); else tmp = Float64(2.0 * Float64(y * fma(t_1, Float64(fma(c, b, a) / y), x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * (-c)), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(b * c + a), $MachinePrecision] * t$95$1 + N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(t$95$1 * N[(N[(c * b + a), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(-c\right)\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), t\_1, \mathsf{fma}\left(z, t, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \mathsf{fma}\left(t\_1, \frac{\mathsf{fma}\left(c, b, a\right)}{y}, x\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 95.1%
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
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.2
Applied rewrites99.2%
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 z around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6433.3
Applied rewrites33.3%
Taylor expanded in y around inf
Applied rewrites77.8%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma (fma b c a) (* i (- c)) (* z t))))
(t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -5e+199)
t_1
(if (<= t_2 2e+108) (* 2.0 (- (+ (* x y) (* z t)) (* a (* c 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 * fma(fma(b, c, a), (i * -c), (z * t));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1;
} else if (t_2 <= 2e+108) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * fma(fma(b, c, a), Float64(i * Float64(-c)), Float64(z * t))) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = t_1; elseif (t_2 <= 2e+108) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(b * c + a), $MachinePrecision] * N[(i * (-c)), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], t$95$1, If[LessEqual[t$95$2, 2e+108], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), z \cdot t\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+108}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e199 or 2.0000000000000001e108 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.9%
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
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6491.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6491.2
Applied rewrites91.2%
Taylor expanded in z around inf
lower-*.f6492.2
Applied rewrites92.2%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e108Initial program 99.0%
Taylor expanded in a around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6489.4
Applied rewrites89.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6496.8
Applied rewrites96.8%
Final simplification95.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (fma (fma b c a) (* i (- c)) (* z t))))
(t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -2e-42)
t_1
(if (<= t_2 2e+108) (* 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 = 2.0 * fma(fma(b, c, a), (i * -c), (z * t));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -2e-42) {
tmp = t_1;
} else if (t_2 <= 2e+108) {
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(2.0 * fma(fma(b, c, a), Float64(i * Float64(-c)), Float64(z * t))) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -2e-42) tmp = t_1; elseif (t_2 <= 2e+108) 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[(2.0 * N[(N[(b * c + a), $MachinePrecision] * N[(i * (-c)), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-42], t$95$1, If[LessEqual[t$95$2, 2e+108], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), z \cdot t\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+108}:\\
\;\;\;\;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.00000000000000008e-42 or 2.0000000000000001e108 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.3%
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
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6493.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6493.2
Applied rewrites93.2%
Taylor expanded in z around inf
lower-*.f6485.9
Applied rewrites85.9%
if -2.00000000000000008e-42 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e108Initial program 98.7%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6492.1
Applied rewrites92.1%
Final simplification88.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* c (* i (fma b c a))))))
(t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -2e-42)
t_1
(if (<= t_2 1e+142) (* 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 = 2.0 * ((x * y) - (c * (i * fma(b, c, a))));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -2e-42) {
tmp = t_1;
} else if (t_2 <= 1e+142) {
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(2.0 * Float64(Float64(x * y) - Float64(c * Float64(i * fma(b, c, a))))) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -2e-42) tmp = t_1; elseif (t_2 <= 1e+142) 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[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-42], t$95$1, If[LessEqual[t$95$2, 1e+142], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+142}:\\
\;\;\;\;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.00000000000000008e-42 or 1.00000000000000005e142 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 84.8%
Taylor expanded in z around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6481.5
Applied rewrites81.5%
if -2.00000000000000008e-42 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e142Initial program 98.8%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6491.6
Applied rewrites91.6%
Final simplification86.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (+ a (* b c))) i)))
(if (<= t_1 -5e+199)
(* c (* i (* (fma b c a) -2.0)))
(if (<= t_1 1e+142)
(* 2.0 (fma t z (* x y)))
(* 2.0 (- (* z t) (* c (* i (fma b c a)))))))))
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 (t_1 <= -5e+199) {
tmp = c * (i * (fma(b, c, a) * -2.0));
} else if (t_1 <= 1e+142) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = 2.0 * ((z * t) - (c * (i * fma(b, c, a))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_1 <= -5e+199) tmp = Float64(c * Float64(i * Float64(fma(b, c, a) * -2.0))); elseif (t_1 <= 1e+142) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * fma(b, c, a))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+199], N[(c * N[(i * N[(N[(b * c + a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+142], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;c \cdot \left(i \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot -2\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+142}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e199Initial program 78.3%
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.f6488.4
Applied rewrites88.4%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e142Initial program 99.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
if 1.00000000000000005e142 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.5%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6484.9
Applied rewrites84.9%
Final simplification86.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) INFINITY) (* 2.0 (fma (fma b c a) (* i (- c)) (fma z t (* x y)))) (* c (* a (* i -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * fma(fma(b, c, a), (i * -c), fma(z, t, (x * y)));
} else {
tmp = c * (a * (i * -2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) <= Inf) tmp = Float64(2.0 * fma(fma(b, c, a), Float64(i * Float64(-c)), fma(z, t, Float64(x * y)))); else tmp = Float64(c * Float64(a * Float64(i * -2.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(b * c + a), $MachinePrecision] * N[(i * (-c)), $MachinePrecision] + N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(a * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), \mathsf{fma}\left(z, t, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\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 95.1%
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
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.2
Applied rewrites99.2%
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 inf
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.1
Applied rewrites67.1%
Final simplification98.0%
(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))) i)))
(if (<= t_2 -5e+199)
t_1
(if (<= t_2 1e+142) (* 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))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1;
} else if (t_2 <= 1e+142) {
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(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = t_1; elseif (t_2 <= 1e+142) 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[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], t$95$1, If[LessEqual[t$95$2, 1e+142], 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 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+142}:\\
\;\;\;\;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) < -4.9999999999999998e199 or 1.00000000000000005e142 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.2%
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.f6485.4
Applied rewrites85.4%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e142Initial program 99.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6485.9
Applied rewrites85.9%
Final simplification85.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* i -2.0))) (t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -5e+199)
(* b (* c t_1))
(if (<= t_2 2e+196) (* 2.0 (fma t z (* x y))) (* (* b c) 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 * -2.0);
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = b * (c * t_1);
} else if (t_2 <= 2e+196) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = (b * c) * t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(i * -2.0)) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = Float64(b * Float64(c * t_1)); elseif (t_2 <= 2e+196) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(Float64(b * c) * t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], N[(b * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+196], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(i \cdot -2\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;b \cdot \left(c \cdot t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c\right) \cdot t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.9999999999999998e199Initial program 78.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-*.f6463.3
Applied rewrites63.3%
Applied rewrites67.7%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e196Initial program 99.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6485.0
Applied rewrites85.0%
if 1.9999999999999999e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.5%
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-*.f6457.6
Applied rewrites57.6%
Applied rewrites59.2%
Applied rewrites64.2%
Final simplification77.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (* c (* c (* i -2.0))))) (t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -5e+199)
t_1
(if (<= t_2 2e+196) (* 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 * (c * (c * (i * -2.0)));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1;
} else if (t_2 <= 2e+196) {
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(c * Float64(c * Float64(i * -2.0)))) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = t_1; elseif (t_2 <= 2e+196) 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[(c * N[(c * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], t$95$1, If[LessEqual[t$95$2, 2e+196], 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(c \cdot \left(c \cdot \left(i \cdot -2\right)\right)\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;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) < -4.9999999999999998e199 or 1.9999999999999999e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.5%
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-*.f6460.0
Applied rewrites60.0%
Applied rewrites62.8%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e196Initial program 99.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6485.0
Applied rewrites85.0%
Final simplification76.8%
(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))) i)))
(if (<= t_2 -5e+199)
t_1
(if (<= t_2 2e+196) (* 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))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1;
} else if (t_2 <= 2e+196) {
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(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = t_1; elseif (t_2 <= 2e+196) 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[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], t$95$1, If[LessEqual[t$95$2, 2e+196], 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 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;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) < -4.9999999999999998e199 or 1.9999999999999999e196 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.5%
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-*.f6460.0
Applied rewrites60.0%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e196Initial program 99.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6485.0
Applied rewrites85.0%
Final simplification75.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* c (* i -2.0)))) (t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -5e+199)
t_1
(if (<= t_2 1e+300) (* 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 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -5e+199) {
tmp = t_1;
} else if (t_2 <= 1e+300) {
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(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -5e+199) tmp = t_1; elseif (t_2 <= 1e+300) 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[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+199], t$95$1, If[LessEqual[t$95$2, 1e+300], 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 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+300}:\\
\;\;\;\;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) < -4.9999999999999998e199 or 1.0000000000000001e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.9%
Taylor expanded in z around inf
lower-*.f647.9
Applied rewrites7.9%
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-*.f6451.0
Applied rewrites51.0%
if -4.9999999999999998e199 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e300Initial program 99.1%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6480.9
Applied rewrites80.9%
Final simplification71.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* x y))))
(if (<= (* x y) -1.35e-25)
t_1
(if (<= (* x y) 1.4e+115) (* 2.0 (* z t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -1.35e-25) {
tmp = t_1;
} else if ((x * y) <= 1.4e+115) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (x * y)
if ((x * y) <= (-1.35d-25)) then
tmp = t_1
else if ((x * y) <= 1.4d+115) then
tmp = 2.0d0 * (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -1.35e-25) {
tmp = t_1;
} else if ((x * y) <= 1.4e+115) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (x * y) tmp = 0 if (x * y) <= -1.35e-25: tmp = t_1 elif (x * y) <= 1.4e+115: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.35e-25) tmp = t_1; elseif (Float64(x * y) <= 1.4e+115) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -1.35e-25) tmp = t_1; elseif ((x * y) <= 1.4e+115) tmp = 2.0 * (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.35e-25], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e+115], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{+115}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35000000000000008e-25 or 1.4e115 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf
lower-*.f6457.6
Applied rewrites57.6%
if -1.35000000000000008e-25 < (*.f64 x y) < 1.4e115Initial program 92.0%
Taylor expanded in z around inf
lower-*.f6443.2
Applied rewrites43.2%
Final simplification49.8%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 91.8%
Taylor expanded in z around inf
lower-*.f6430.7
Applied rewrites30.7%
Final simplification30.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 2024221
(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))))