
(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 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 (- INFINITY))
(* (* -2.0 (* (fma c b a) i)) c)
(if (<= t_1 5e+291)
(* 2.0 (- (+ (* x y) (* z t)) t_1))
(* (fma (* i (fma c b a)) (- c) (fma t z (* y x))) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (-2.0 * (fma(c, b, a) * i)) * c;
} else if (t_1 <= 5e+291) {
tmp = 2.0 * (((x * y) + (z * t)) - t_1);
} else {
tmp = fma((i * fma(c, b, a)), -c, fma(t, z, (y * x))) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c); elseif (t_1 <= 5e+291) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - t_1)); else tmp = Float64(fma(Float64(i * fma(c, b, a)), Float64(-c), fma(t, z, Float64(y * x))) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 5e+291], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * (-c) + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 78.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6491.4
Applied rewrites91.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e291Initial program 98.6%
if 5.0000000000000001e291 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites89.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* -2.0 (* (* b c) i)) c)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e+52)
(* (* (* i c) a) -2.0)
(if (<= t_2 4e+282) (* 2.0 (fma t z (* y x))) 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 * c) * i)) * c;
double t_2 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e+52) {
tmp = ((i * c) * a) * -2.0;
} else if (t_2 <= 4e+282) {
tmp = 2.0 * fma(t, z, (y * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-2.0 * Float64(Float64(b * c) * i)) * c) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e+52) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_2 <= 4e+282) tmp = Float64(2.0 * fma(t, z, Float64(y * x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-2.0 * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e+52], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 4e+282], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-2 \cdot \left(\left(b \cdot c\right) \cdot i\right)\right) \cdot c\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+52}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.00000000000000013e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.8
Applied rewrites89.8%
Taylor expanded in a around 0
Applied rewrites70.5%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
Applied rewrites62.3%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000013e282Initial program 98.4%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* (* c c) i) b) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e+52)
(* (* (* i c) a) -2.0)
(if (<= t_2 4e+282) (* 2.0 (fma t z (* y x))) 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 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e+52) {
tmp = ((i * c) * a) * -2.0;
} else if (t_2 <= 4e+282) {
tmp = 2.0 * fma(t, z, (y * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(c * c) * i) * b) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e+52) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_2 <= 4e+282) tmp = Float64(2.0 * fma(t, z, Float64(y * x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e+52], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 4e+282], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(c \cdot c\right) \cdot i\right) \cdot b\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+52}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.00000000000000013e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.8
Applied rewrites89.8%
Taylor expanded in a around 0
Applied rewrites69.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
Applied rewrites62.3%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000013e282Initial program 98.4%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* b (* c c)) i) -2.0)) (t_2 (* (* (+ a (* b c)) c) i)))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 -2e+52)
(* (* (* i c) a) -2.0)
(if (<= t_2 4e+282) (* 2.0 (fma t z (* y x))) 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 = ((a + (b * c)) * c) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= -2e+52) {
tmp = ((i * c) * a) * -2.0;
} else if (t_2 <= 4e+282) {
tmp = 2.0 * fma(t, z, (y * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(b * Float64(c * c)) * i) * -2.0) t_2 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= -2e+52) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_2 <= 4e+282) tmp = Float64(2.0 * fma(t, z, Float64(y * x))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(b * N[(c * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e+52], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 4e+282], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot \left(c \cdot c\right)\right) \cdot i\right) \cdot -2\\
t_2 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+52}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.00000000000000013e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 79.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.8
Applied rewrites89.8%
Taylor expanded in a around 0
Applied rewrites69.2%
Applied rewrites67.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6462.3
Applied rewrites62.3%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000013e282Initial program 98.4%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6482.1
Applied rewrites82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 (- INFINITY))
(* (* -2.0 (* (fma c b a) i)) c)
(if (<= t_1 4e+282)
(* 2.0 (fma (- i) (* c a) (fma t z (* y x))))
(* (* -2.0 (fma b c a)) (* c 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)) * c) * i;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (-2.0 * (fma(c, b, a) * i)) * c;
} else if (t_1 <= 4e+282) {
tmp = 2.0 * fma(-i, (c * a), fma(t, z, (y * x)));
} else {
tmp = (-2.0 * fma(b, c, a)) * (c * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c); elseif (t_1 <= 4e+282) tmp = Float64(2.0 * fma(Float64(-i), Float64(c * a), fma(t, z, Float64(y * x)))); else tmp = Float64(Float64(-2.0 * fma(b, c, a)) * Float64(c * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 4e+282], N[(2.0 * N[((-i) * N[(c * a), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(-i, c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 78.6%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6491.4
Applied rewrites91.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000013e282Initial program 98.6%
Taylor expanded in b around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6492.4
Applied rewrites92.4%
if 4.00000000000000013e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.7%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.2
Applied rewrites88.2%
Applied rewrites88.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 -2e+52) (not (<= t_1 2e+52)))
(* (* -2.0 (fma b c a)) (* c i))
(* 2.0 (fma t z (* y x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -2e+52) || !(t_1 <= 2e+52)) {
tmp = (-2.0 * fma(b, c, a)) * (c * i);
} else {
tmp = 2.0 * fma(t, z, (y * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if ((t_1 <= -2e+52) || !(t_1 <= 2e+52)) tmp = Float64(Float64(-2.0 * fma(b, c, a)) * Float64(c * i)); else tmp = Float64(2.0 * fma(t, z, Float64(y * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+52], N[Not[LessEqual[t$95$1, 2e+52]], $MachinePrecision]], N[(N[(-2.0 * N[(b * c + a), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+52} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+52}\right):\\
\;\;\;\;\left(-2 \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot \left(c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52 or 2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6478.8
Applied rewrites78.8%
Applied rewrites83.2%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e52Initial program 98.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.3
Applied rewrites89.3%
Final simplification85.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 -2e+52) (not (<= t_1 2e+52)))
(* (* -2.0 (* (fma c b a) i)) c)
(* 2.0 (fma t z (* y x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -2e+52) || !(t_1 <= 2e+52)) {
tmp = (-2.0 * (fma(c, b, a) * i)) * c;
} else {
tmp = 2.0 * fma(t, z, (y * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if ((t_1 <= -2e+52) || !(t_1 <= 2e+52)) tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c); else tmp = Float64(2.0 * fma(t, z, Float64(y * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+52], N[Not[LessEqual[t$95$1, 2e+52]], $MachinePrecision]], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+52} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+52}\right):\\
\;\;\;\;\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52 or 2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.4%
Taylor expanded in i around inf
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
distribute-lft-outN/A
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6478.8
Applied rewrites78.8%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e52Initial program 98.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6489.3
Applied rewrites89.3%
Final simplification83.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 -2e+52) (not (<= t_1 5e+244)))
(* (* (* i c) a) -2.0)
(* 2.0 (fma t z (* y x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -2e+52) || !(t_1 <= 5e+244)) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = 2.0 * fma(t, z, (y * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if ((t_1 <= -2e+52) || !(t_1 <= 5e+244)) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = Float64(2.0 * fma(t, z, Float64(y * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+52], N[Not[LessEqual[t$95$1, 5e+244]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+52} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+244}\right):\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52 or 5.00000000000000022e244 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 83.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000022e244Initial program 98.4%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.2
Applied rewrites83.2%
Final simplification62.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 -2e+52) (not (<= t_1 1e+33)))
(* (* (* i c) a) -2.0)
(* 2.0 (* t z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -2e+52) || !(t_1 <= 1e+33)) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = 2.0 * (t * z);
}
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)) * c) * i
if ((t_1 <= (-2d+52)) .or. (.not. (t_1 <= 1d+33))) then
tmp = ((i * c) * a) * (-2.0d0)
else
tmp = 2.0d0 * (t * z)
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)) * c) * i;
double tmp;
if ((t_1 <= -2e+52) || !(t_1 <= 1e+33)) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = 2.0 * (t * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a + (b * c)) * c) * i tmp = 0 if (t_1 <= -2e+52) or not (t_1 <= 1e+33): tmp = ((i * c) * a) * -2.0 else: tmp = 2.0 * (t * z) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * c) * i) tmp = 0.0 if ((t_1 <= -2e+52) || !(t_1 <= 1e+33)) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = Float64(2.0 * Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a + (b * c)) * c) * i; tmp = 0.0; if ((t_1 <= -2e+52) || ~((t_1 <= 1e+33))) tmp = ((i * c) * a) * -2.0; else tmp = 2.0 * (t * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+52], N[Not[LessEqual[t$95$1, 1e+33]], $MachinePrecision]], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+52} \lor \neg \left(t\_1 \leq 10^{+33}\right):\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2e52 or 9.9999999999999995e32 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
if -2e52 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999995e32Initial program 98.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6455.2
Applied rewrites55.2%
Final simplification46.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* y x))))
(if (<= (* x y) -1e+56)
t_1
(if (<= (* x y) 5e-177)
(* 2.0 (* t z))
(if (<= (* x y) 1e+106) (* (* (* a i) -2.0) c) 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 * (y * x);
double tmp;
if ((x * y) <= -1e+56) {
tmp = t_1;
} else if ((x * y) <= 5e-177) {
tmp = 2.0 * (t * z);
} else if ((x * y) <= 1e+106) {
tmp = ((a * i) * -2.0) * c;
} 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 * (y * x)
if ((x * y) <= (-1d+56)) then
tmp = t_1
else if ((x * y) <= 5d-177) then
tmp = 2.0d0 * (t * z)
else if ((x * y) <= 1d+106) then
tmp = ((a * i) * (-2.0d0)) * c
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 * (y * x);
double tmp;
if ((x * y) <= -1e+56) {
tmp = t_1;
} else if ((x * y) <= 5e-177) {
tmp = 2.0 * (t * z);
} else if ((x * y) <= 1e+106) {
tmp = ((a * i) * -2.0) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (y * x) tmp = 0 if (x * y) <= -1e+56: tmp = t_1 elif (x * y) <= 5e-177: tmp = 2.0 * (t * z) elif (x * y) <= 1e+106: tmp = ((a * i) * -2.0) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(y * x)) tmp = 0.0 if (Float64(x * y) <= -1e+56) tmp = t_1; elseif (Float64(x * y) <= 5e-177) tmp = Float64(2.0 * Float64(t * z)); elseif (Float64(x * y) <= 1e+106) tmp = Float64(Float64(Float64(a * i) * -2.0) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (y * x); tmp = 0.0; if ((x * y) <= -1e+56) tmp = t_1; elseif ((x * y) <= 5e-177) tmp = 2.0 * (t * z); elseif ((x * y) <= 1e+106) tmp = ((a * i) * -2.0) * c; 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[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+56], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-177], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+106], N[(N[(N[(a * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot x\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-177}:\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+106}:\\
\;\;\;\;\left(\left(a \cdot i\right) \cdot -2\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000009e56 or 1.00000000000000009e106 < (*.f64 x y) Initial program 90.8%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.2
Applied rewrites64.2%
if -1.00000000000000009e56 < (*.f64 x y) < 5e-177Initial program 91.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
if 5e-177 < (*.f64 x y) < 1.00000000000000009e106Initial program 89.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
lower-*.f64N/A
distribute-lft-outN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6459.8
Applied rewrites59.8%
Taylor expanded in a around inf
Applied rewrites40.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma t z (* y x))))
(if (or (<= c -1.25e-25) (not (<= c 2e-121)))
(* (fma (* i (fma c b a)) (- c) t_1) 2.0)
(* 2.0 (fma (- i) (* c a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(t, z, (y * x));
double tmp;
if ((c <= -1.25e-25) || !(c <= 2e-121)) {
tmp = fma((i * fma(c, b, a)), -c, t_1) * 2.0;
} else {
tmp = 2.0 * fma(-i, (c * a), t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(t, z, Float64(y * x)) tmp = 0.0 if ((c <= -1.25e-25) || !(c <= 2e-121)) tmp = Float64(fma(Float64(i * fma(c, b, a)), Float64(-c), t_1) * 2.0); else tmp = Float64(2.0 * fma(Float64(-i), Float64(c * a), t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[c, -1.25e-25], N[Not[LessEqual[c, 2e-121]], $MachinePrecision]], N[(N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * (-c) + t$95$1), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[((-i) * N[(c * a), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{if}\;c \leq -1.25 \cdot 10^{-25} \lor \neg \left(c \leq 2 \cdot 10^{-121}\right):\\
\;\;\;\;\mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, t\_1\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(-i, c \cdot a, t\_1\right)\\
\end{array}
\end{array}
if c < -1.2499999999999999e-25 or 2e-121 < c Initial program 86.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6486.4
Applied rewrites93.3%
if -1.2499999999999999e-25 < c < 2e-121Initial program 98.8%
Taylor expanded in b around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6497.8
Applied rewrites97.8%
Final simplification94.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e+56) (not (<= (* x y) 5e+162))) (* 2.0 (* y x)) (* 2.0 (* t z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+56) || !((x * y) <= 5e+162)) {
tmp = 2.0 * (y * x);
} else {
tmp = 2.0 * (t * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1d+56)) .or. (.not. ((x * y) <= 5d+162))) then
tmp = 2.0d0 * (y * x)
else
tmp = 2.0d0 * (t * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+56) || !((x * y) <= 5e+162)) {
tmp = 2.0 * (y * x);
} else {
tmp = 2.0 * (t * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+56) or not ((x * y) <= 5e+162): tmp = 2.0 * (y * x) else: tmp = 2.0 * (t * z) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+56) || !(Float64(x * y) <= 5e+162)) tmp = Float64(2.0 * Float64(y * x)); else tmp = Float64(2.0 * Float64(t * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e+56) || ~(((x * y) <= 5e+162))) tmp = 2.0 * (y * x); else tmp = 2.0 * (t * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+56], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+162]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+56} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+162}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000009e56 or 4.9999999999999997e162 < (*.f64 x y) Initial program 89.8%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
Applied rewrites67.5%
if -1.00000000000000009e56 < (*.f64 x y) < 4.9999999999999997e162Initial program 91.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6436.9
Applied rewrites36.9%
Final simplification45.1%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* t z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (t * 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 = 2.0d0 * (t * z)
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 * (t * z);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (t * z)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(t * z)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (t * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(t \cdot z\right)
\end{array}
Initial program 90.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6430.6
Applied rewrites30.6%
(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 2024323
(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))))