
(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 z t (* (- c) (* (fma b c a) i))))
(if (<= t_1 1e+296)
(* 2.0 (fma z t (- (* y x) (* i (* (fma c b a) c)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (fma i (/ a c) (* i b)) c) c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 2.0 * fma(z, t, (-c * (fma(b, c, a) * i)));
} else if (t_1 <= 1e+296) {
tmp = 2.0 * fma(z, t, ((y * x) - (i * (fma(c, b, a) * c))));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - ((fma(i, (a / c), (i * b)) * c) * c));
}
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(2.0 * fma(z, t, Float64(Float64(-c) * Float64(fma(b, c, a) * i)))); elseif (t_1 <= 1e+296) tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(i * Float64(fma(c, b, a) * c))))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(fma(i, Float64(a / c), Float64(i * b)) * c) * c))); 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[(2.0 * N[(z * t + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+296], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(i * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(i * N[(a / c), $MachinePrecision] + N[(i * b), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * c), $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 -\infty:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+296}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\mathsf{fma}\left(i, \frac{a}{c}, i \cdot b\right) \cdot c\right) \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 66.1%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6468.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6468.2
Applied rewrites68.2%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6494.1
Applied rewrites94.1%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999981e295Initial program 98.6%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6498.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6498.6
Applied rewrites98.6%
if 9.99999999999999981e295 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 71.8%
Taylor expanded in c around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6490.3
Applied rewrites90.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+302)))
(* 2.0 (fma z t (* (- c) (* (fma b c a) i))))
(* 2.0 (fma z t (- (* y x) (* i (* (fma c b a) c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+302)) {
tmp = 2.0 * fma(z, t, (-c * (fma(b, c, a) * i)));
} else {
tmp = 2.0 * fma(z, t, ((y * x) - (i * (fma(c, b, a) * c))));
}
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)) || !(t_1 <= 1e+302)) tmp = Float64(2.0 * fma(z, t, Float64(Float64(-c) * Float64(fma(b, c, a) * i)))); else tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(i * Float64(fma(c, b, a) * c))))); 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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+302]], $MachinePrecision]], N[(2.0 * N[(z * t + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(i * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_1 \leq 10^{+302}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1.0000000000000001e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 68.8%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6471.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.8
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6471.8
Applied rewrites71.8%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6490.3
Applied rewrites90.3%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e302Initial program 98.6%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6498.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6498.6
Applied rewrites98.6%
Final simplification95.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+242)))
(* 2.0 (fma z t (* (- c) (* (fma b c a) i))))
(* 2.0 (fma z t (- (* y x) (* i (* a c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * c) * i;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+242)) {
tmp = 2.0 * fma(z, t, (-c * (fma(b, c, a) * i)));
} else {
tmp = 2.0 * fma(z, t, ((y * x) - (i * (a * c))));
}
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)) || !(t_1 <= 1e+242)) tmp = Float64(2.0 * fma(z, t, Float64(Float64(-c) * Float64(fma(b, c, a) * i)))); else tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(i * Float64(a * c))))); 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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+242]], $MachinePrecision]], N[(2.0 * N[(z * t + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_1 \leq 10^{+242}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1.00000000000000005e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.2%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6473.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6473.0
Applied rewrites73.0%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6488.3
Applied rewrites88.3%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e242Initial program 99.2%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6499.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.2
Applied rewrites99.2%
Taylor expanded in a around inf
lower-*.f6492.7
Applied rewrites92.7%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+242)))
(* 2.0 (fma z t (* (- c) (* (fma b c a) i))))
(* 2.0 (fma (- i) (* c a) (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 <= -((double) INFINITY)) || !(t_1 <= 1e+242)) {
tmp = 2.0 * fma(z, t, (-c * (fma(b, c, a) * i)));
} else {
tmp = 2.0 * fma(-i, (c * a), 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 <= Float64(-Inf)) || !(t_1 <= 1e+242)) tmp = Float64(2.0 * fma(z, t, Float64(Float64(-c) * Float64(fma(b, c, a) * i)))); else tmp = Float64(2.0 * fma(Float64(-i), Float64(c * a), 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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+242]], $MachinePrecision]], N[(2.0 * N[(z * t + N[((-c) * N[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[((-i) * N[(c * a), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_1 \leq 10^{+242}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \left(-c\right) \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(-i, c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1.00000000000000005e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.2%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6473.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6473.0
Applied rewrites73.0%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6488.3
Applied rewrites88.3%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e242Initial program 99.2%
Taylor expanded in b around 0
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6492.6
Applied rewrites92.6%
Final simplification90.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+242)))
(* (* -2.0 (* (fma c b a) i)) c)
(* 2.0 (fma (- i) (* c a) (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 <= -((double) INFINITY)) || !(t_1 <= 1e+242)) {
tmp = (-2.0 * (fma(c, b, a) * i)) * c;
} else {
tmp = 2.0 * fma(-i, (c * a), 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 <= Float64(-Inf)) || !(t_1 <= 1e+242)) tmp = Float64(Float64(-2.0 * Float64(fma(c, b, a) * i)) * c); else tmp = Float64(2.0 * fma(Float64(-i), Float64(c * a), 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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+242]], $MachinePrecision]], N[(N[(-2.0 * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(2.0 * N[((-i) * N[(c * a), $MachinePrecision] + N[(t * z + N[(y * x), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_1 \leq 10^{+242}\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(-i, c \cdot a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1.00000000000000005e242 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 70.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
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.f6483.6
Applied rewrites83.6%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000005e242Initial program 99.2%
Taylor expanded in b around 0
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6492.6
Applied rewrites92.6%
Final simplification88.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+161)))
(* (* -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 <= -((double) INFINITY)) || !(t_1 <= 2e+161)) {
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 <= Float64(-Inf)) || !(t_1 <= 2e+161)) 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+161]], $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+161}\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) < -inf.0 or 2.0000000000000001e161 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.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.f6480.9
Applied rewrites80.9%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e161Initial program 99.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.9
Applied rewrites73.9%
Final simplification77.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+161)))
(* (* (* c i) (* b c)) -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 <= -((double) INFINITY)) || !(t_1 <= 2e+161)) {
tmp = ((c * i) * (b * c)) * -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 <= Float64(-Inf)) || !(t_1 <= 2e+161)) tmp = Float64(Float64(Float64(c * i) * Float64(b * c)) * -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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+161]], $MachinePrecision]], N[(N[(N[(c * i), $MachinePrecision] * N[(b * c), $MachinePrecision]), $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+161}\right):\\
\;\;\;\;\left(\left(c \cdot i\right) \cdot \left(b \cdot c\right)\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) < -inf.0 or 2.0000000000000001e161 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.0
Applied rewrites57.0%
Applied rewrites60.3%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e161Initial program 99.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.9
Applied rewrites73.9%
Final simplification67.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+161)))
(* (* (* (* c i) -2.0) b) 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 <= -((double) INFINITY)) || !(t_1 <= 2e+161)) {
tmp = (((c * i) * -2.0) * b) * 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 <= Float64(-Inf)) || !(t_1 <= 2e+161)) tmp = Float64(Float64(Float64(Float64(c * i) * -2.0) * b) * 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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+161]], $MachinePrecision]], N[(N[(N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision] * b), $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+161}\right):\\
\;\;\;\;\left(\left(\left(c \cdot i\right) \cdot -2\right) \cdot b\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) < -inf.0 or 2.0000000000000001e161 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6475.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.2
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6475.2
Applied rewrites75.2%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.1
Applied rewrites59.1%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e161Initial program 99.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.9
Applied rewrites73.9%
Final simplification67.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) c) i)))
(if (<= t_1 (- INFINITY))
(* (* (* c i) (* b c)) -2.0)
(if (<= t_1 4e+266)
(* 2.0 (fma t z (* y x)))
(* (* (* (* c i) c) b) -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 = ((c * i) * (b * c)) * -2.0;
} else if (t_1 <= 4e+266) {
tmp = 2.0 * fma(t, z, (y * x));
} else {
tmp = (((c * i) * c) * b) * -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(Float64(c * i) * Float64(b * c)) * -2.0); elseif (t_1 <= 4e+266) tmp = Float64(2.0 * fma(t, z, Float64(y * x))); else tmp = Float64(Float64(Float64(Float64(c * i) * c) * b) * -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[(N[(c * i), $MachinePrecision] * N[(b * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 4e+266], N[(2.0 * N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(c * i), $MachinePrecision] * c), $MachinePrecision] * b), $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(\left(c \cdot i\right) \cdot \left(b \cdot c\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+266}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot i\right) \cdot c\right) \cdot b\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 66.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.4
Applied rewrites63.4%
Applied rewrites65.8%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000001e266Initial program 98.5%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6469.7
Applied rewrites69.7%
if 4.0000000000000001e266 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 73.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
Applied rewrites64.2%
Final simplification67.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4e+104) (not (<= (* x y) 2e+119))) (* 2.0 (* y x)) (* (* (* i c) a) -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) <= -4e+104) || !((x * y) <= 2e+119)) {
tmp = 2.0 * (y * x);
} else {
tmp = ((i * c) * a) * -2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-4d+104)) .or. (.not. ((x * y) <= 2d+119))) then
tmp = 2.0d0 * (y * x)
else
tmp = ((i * c) * a) * (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -4e+104) || !((x * y) <= 2e+119)) {
tmp = 2.0 * (y * x);
} else {
tmp = ((i * c) * a) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -4e+104) or not ((x * y) <= 2e+119): tmp = 2.0 * (y * x) else: tmp = ((i * c) * a) * -2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -4e+104) || !(Float64(x * y) <= 2e+119)) tmp = Float64(2.0 * Float64(y * x)); else tmp = Float64(Float64(Float64(i * c) * a) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -4e+104) || ~(((x * y) <= 2e+119))) tmp = 2.0 * (y * x); else tmp = ((i * c) * a) * -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4e+104], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+119]], $MachinePrecision]], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+104} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+119}\right):\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 x y) < -4e104 or 1.99999999999999989e119 < (*.f64 x y) Initial program 81.6%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.7
Applied rewrites60.7%
if -4e104 < (*.f64 x y) < 1.99999999999999989e119Initial program 90.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6436.3
Applied rewrites36.3%
Final simplification44.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -50000.0) (not (<= (* z t) 1e+34))) (* t (+ z z)) (* 2.0 (* y x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -50000.0) || !((z * t) <= 1e+34)) {
tmp = t * (z + z);
} else {
tmp = 2.0 * (y * x);
}
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 (((z * t) <= (-50000.0d0)) .or. (.not. ((z * t) <= 1d+34))) then
tmp = t * (z + z)
else
tmp = 2.0d0 * (y * x)
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 (((z * t) <= -50000.0) || !((z * t) <= 1e+34)) {
tmp = t * (z + z);
} else {
tmp = 2.0 * (y * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -50000.0) or not ((z * t) <= 1e+34): tmp = t * (z + z) else: tmp = 2.0 * (y * x) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -50000.0) || !(Float64(z * t) <= 1e+34)) tmp = Float64(t * Float64(z + z)); else tmp = Float64(2.0 * Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -50000.0) || ~(((z * t) <= 1e+34))) tmp = t * (z + z); else tmp = 2.0 * (y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+34]], $MachinePrecision]], N[(t * N[(z + z), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -50000 \lor \neg \left(z \cdot t \leq 10^{+34}\right):\\
\;\;\;\;t \cdot \left(z + z\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -5e4 or 9.99999999999999946e33 < (*.f64 z t) Initial program 84.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6452.2
Applied rewrites52.2%
Applied rewrites52.2%
if -5e4 < (*.f64 z t) < 9.99999999999999946e33Initial program 89.1%
Taylor expanded in x around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
Final simplification44.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -4.5e+153) (* (* (* 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 tmp;
if (a <= -4.5e+153) {
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) tmp = 0.0 if (a <= -4.5e+153) 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_] := If[LessEqual[a, -4.5e+153], 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}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+153}:\\
\;\;\;\;\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 a < -4.5000000000000001e153Initial program 81.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
if -4.5000000000000001e153 < a Initial program 88.2%
Taylor expanded in c around 0
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6456.0
Applied rewrites56.0%
Final simplification57.8%
(FPCore (x y z t a b c i) :precision binary64 (* t (+ z z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z + 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 * (z + 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 * (z + z);
}
def code(x, y, z, t, a, b, c, i): return t * (z + z)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z + z)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z + z); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z + z\right)
\end{array}
Initial program 87.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6424.8
Applied rewrites24.8%
Applied rewrites24.8%
Final simplification24.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 2024342
(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))))