
(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 15 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 (if (<= (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) INFINITY) (* 2.0 (fma z t (fma c (- (* i (fma b c a))) (* x y)))) (* 2.0 (fma z t (* c (* b (* c (- i))))))))
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(z, t, fma(c, -(i * fma(b, c, a)), (x * y)));
} else {
tmp = 2.0 * fma(z, t, (c * (b * (c * -i))));
}
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(z, t, fma(c, Float64(-Float64(i * fma(b, c, a))), Float64(x * y)))); else tmp = Float64(2.0 * fma(z, t, Float64(c * Float64(b * Float64(c * Float64(-i)))))); 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[(z * t + N[(c * (-N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t + N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $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(z, t, \mathsf{fma}\left(c, -i \cdot \mathsf{fma}\left(b, c, a\right), x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 95.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites96.8%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites33.3%
Taylor expanded in c around inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6483.4
Applied rewrites83.4%
Final simplification96.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (<= t_1 -1e+141)
(* b (* i (* -2.0 (* c c))))
(if (<= t_1 -1e+47)
(* a (* -2.0 (* c i)))
(if (<= t_1 2e+170)
(* 2.0 (fma t z (* x y)))
(* (* c (* b (* c i))) -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * (a + (b * c));
double tmp;
if (t_1 <= -1e+141) {
tmp = b * (i * (-2.0 * (c * c)));
} else if (t_1 <= -1e+47) {
tmp = a * (-2.0 * (c * i));
} else if (t_1 <= 2e+170) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = (c * (b * (c * i))) * -2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_1 <= -1e+141) tmp = Float64(b * Float64(i * Float64(-2.0 * Float64(c * c)))); elseif (t_1 <= -1e+47) tmp = Float64(a * Float64(-2.0 * Float64(c * i))); elseif (t_1 <= 2e+170) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = Float64(Float64(c * Float64(b * Float64(c * i))) * -2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+141], N[(b * N[(i * N[(-2.0 * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+47], N[(a * N[(-2.0 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+170], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;b \cdot \left(i \cdot \left(-2 \cdot \left(c \cdot c\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+47}:\\
\;\;\;\;a \cdot \left(-2 \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+170}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000002e141Initial program 83.2%
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-*.f6468.6
Applied rewrites68.6%
if -1.00000000000000002e141 < (*.f64 (+.f64 a (*.f64 b c)) c) < -1e47Initial program 99.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites80.9%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6474.3
Applied rewrites74.3%
Taylor expanded in a around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6479.4
Applied rewrites79.4%
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6479.4
Applied rewrites79.4%
if -1e47 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000007e170Initial program 98.3%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6481.1
Applied rewrites81.1%
if 2.00000000000000007e170 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 82.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites90.9%
Taylor expanded in c around inf
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6471.2
Applied rewrites71.2%
Final simplification75.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (* b (* c i))) -2.0)) (t_2 (* c (+ a (* b c)))))
(if (<= t_2 -1e+141)
t_1
(if (<= t_2 -1e+47)
(* a (* -2.0 (* c i)))
(if (<= t_2 2e+170) (* 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 * (b * (c * i))) * -2.0;
double t_2 = c * (a + (b * c));
double tmp;
if (t_2 <= -1e+141) {
tmp = t_1;
} else if (t_2 <= -1e+47) {
tmp = a * (-2.0 * (c * i));
} else if (t_2 <= 2e+170) {
tmp = 2.0 * fma(t, z, (x * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * Float64(b * Float64(c * i))) * -2.0) t_2 = Float64(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_2 <= -1e+141) tmp = t_1; elseif (t_2 <= -1e+47) tmp = Float64(a * Float64(-2.0 * Float64(c * i))); elseif (t_2 <= 2e+170) tmp = Float64(2.0 * fma(t, z, Float64(x * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+141], t$95$1, If[LessEqual[t$95$2, -1e+47], N[(a * N[(-2.0 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+170], N[(2.0 * N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\
t_2 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+47}:\\
\;\;\;\;a \cdot \left(-2 \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+170}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000002e141 or 2.00000000000000007e170 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 82.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites92.8%
Taylor expanded in c around inf
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
if -1.00000000000000002e141 < (*.f64 (+.f64 a (*.f64 b c)) c) < -1e47Initial program 99.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites80.9%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6474.3
Applied rewrites74.3%
Taylor expanded in a around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6479.4
Applied rewrites79.4%
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6479.4
Applied rewrites79.4%
if -1e47 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000007e170Initial program 98.3%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6481.1
Applied rewrites81.1%
Final simplification74.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* c (+ a (* b c))) i)))
(if (<= t_1 -2e+59)
(* 2.0 (- (* z t) (* c (* i (fma b c a)))))
(if (<= t_1 5e+54)
(* 2.0 (- (fma t z (* x y)) (* c (* a i))))
(* 2.0 (fma (fma c b a) (* c (- i)) (* z t)))))))
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 <= -2e+59) {
tmp = 2.0 * ((z * t) - (c * (i * fma(b, c, a))));
} else if (t_1 <= 5e+54) {
tmp = 2.0 * (fma(t, z, (x * y)) - (c * (a * i)));
} else {
tmp = 2.0 * fma(fma(c, b, a), (c * -i), (z * t));
}
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 <= -2e+59) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * fma(b, c, a))))); elseif (t_1 <= 5e+54) tmp = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(c * Float64(a * i)))); else tmp = Float64(2.0 * fma(fma(c, b, a), Float64(c * Float64(-i)), Float64(z * t))); 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, -2e+59], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+54], N[(2.0 * N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(c * b + a), $MachinePrecision] * N[(c * (-i)), $MachinePrecision] + N[(z * t), $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 -2 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+54}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right), c \cdot \left(-i\right), z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999994e59Initial program 87.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6487.5
Applied rewrites87.5%
if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000005e54Initial program 99.0%
Taylor expanded in b around 0
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6497.2
Applied rewrites97.2%
if 5.00000000000000005e54 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6480.4
Applied rewrites80.4%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
associate-*l*N/A
lower-fma.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6485.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.6
Applied rewrites85.6%
Final simplification90.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* i (fma b c a))))))
(t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -2e+59)
t_1
(if (<= t_2 2e+272) (* 2.0 (- (fma t z (* x y)) (* c (* a i)))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * (i * fma(b, c, a))));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -2e+59) {
tmp = t_1;
} else if (t_2 <= 2e+272) {
tmp = 2.0 * (fma(t, z, (x * y)) - (c * (a * i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - 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+59) tmp = t_1; elseif (t_2 <= 2e+272) tmp = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(c * Float64(a * 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[(z * t), $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+59], t$95$1, If[LessEqual[t$95$2, 2e+272], N[(2.0 * N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - 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^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+272}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999994e59 or 2.0000000000000001e272 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 83.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6487.8
Applied rewrites87.8%
if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e272Initial program 99.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6491.9
Applied rewrites91.9%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* i (fma b c a))))))
(t_2 (* (* c (+ a (* b c))) i)))
(if (<= t_2 -1e-20) t_1 (if (<= t_2 2e+38) (* 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 * ((z * t) - (c * (i * fma(b, c, a))));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -1e-20) {
tmp = t_1;
} else if (t_2 <= 2e+38) {
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(z * t) - 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 <= -1e-20) tmp = t_1; elseif (t_2 <= 2e+38) 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[(z * t), $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, -1e-20], t$95$1, If[LessEqual[t$95$2, 2e+38], 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(z \cdot t - 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 -1 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+38}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999945e-21 or 1.99999999999999995e38 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 86.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6483.2
Applied rewrites83.2%
if -9.99999999999999945e-21 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999995e38Initial program 99.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6491.9
Applied rewrites91.9%
Final simplification86.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (<= t_1 -5e+206)
(* 2.0 (fma (* i (fma c b a)) (- c) (* x y)))
(if (<= t_1 5e+59)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 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));
double tmp;
if (t_1 <= -5e+206) {
tmp = 2.0 * fma((i * fma(c, b, a)), -c, (x * y));
} else if (t_1 <= 5e+59) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} 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(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_1 <= -5e+206) tmp = Float64(2.0 * fma(Float64(i * fma(c, b, a)), Float64(-c), Float64(x * y))); elseif (t_1 <= 5e+59) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); 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[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+206], N[(2.0 * N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * (-c) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+59], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $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 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+206}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, x \cdot y\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\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 a (*.f64 b c)) c) < -5.0000000000000002e206Initial program 81.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites94.2%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6491.4
Applied rewrites91.4%
if -5.0000000000000002e206 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999997e59Initial program 98.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f6493.7
Applied rewrites93.7%
if 4.9999999999999997e59 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 85.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.5
Applied rewrites91.5%
Final simplification92.5%
(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 -2e+59)
t_1
(if (<= t_2 2e+272) (* 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 <= -2e+59) {
tmp = t_1;
} else if (t_2 <= 2e+272) {
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 <= -2e+59) tmp = t_1; elseif (t_2 <= 2e+272) 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, -2e+59], t$95$1, If[LessEqual[t$95$2, 2e+272], 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 -2 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+272}:\\
\;\;\;\;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) < -1.99999999999999994e59 or 2.0000000000000001e272 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 83.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
*-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.f6483.2
Applied rewrites83.2%
if -1.99999999999999994e59 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e272Initial program 99.1%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6482.8
Applied rewrites82.8%
Final simplification83.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (+ a (* b c)))))
(if (<= t_1 -5e+206)
(* 2.0 (fma (* i (fma c b a)) (- c) (* x y)))
(if (<= t_1 5e+59)
(* 2.0 (- (fma t z (* x y)) (* c (* a i))))
(* 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));
double tmp;
if (t_1 <= -5e+206) {
tmp = 2.0 * fma((i * fma(c, b, a)), -c, (x * y));
} else if (t_1 <= 5e+59) {
tmp = 2.0 * (fma(t, z, (x * y)) - (c * (a * i)));
} 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(c * Float64(a + Float64(b * c))) tmp = 0.0 if (t_1 <= -5e+206) tmp = Float64(2.0 * fma(Float64(i * fma(c, b, a)), Float64(-c), Float64(x * y))); elseif (t_1 <= 5e+59) tmp = Float64(2.0 * Float64(fma(t, z, Float64(x * y)) - Float64(c * Float64(a * i)))); 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[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+206], N[(2.0 * N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] * (-c) + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+59], N[(2.0 * N[(N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $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 := c \cdot \left(a + b \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+206}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(i \cdot \mathsf{fma}\left(c, b, a\right), -c, x \cdot y\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - c \cdot \left(a \cdot i\right)\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 a (*.f64 b c)) c) < -5.0000000000000002e206Initial program 81.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites94.2%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6491.4
Applied rewrites91.4%
if -5.0000000000000002e206 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999997e59Initial program 98.4%
Taylor expanded in b around 0
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6489.9
Applied rewrites89.9%
if 4.9999999999999997e59 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 85.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6491.5
Applied rewrites91.5%
Final simplification90.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* a (* -2.0 (* c i)))) (t_2 (* (* c (+ a (* b c))) i))) (if (<= t_2 -1e-20) t_1 (if (<= t_2 5e+107) (* y (* x 2.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (-2.0 * (c * i));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -1e-20) {
tmp = t_1;
} else if (t_2 <= 5e+107) {
tmp = y * (x * 2.0);
} 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) :: t_2
real(8) :: tmp
t_1 = a * ((-2.0d0) * (c * i))
t_2 = (c * (a + (b * c))) * i
if (t_2 <= (-1d-20)) then
tmp = t_1
else if (t_2 <= 5d+107) then
tmp = y * (x * 2.0d0)
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 = a * (-2.0 * (c * i));
double t_2 = (c * (a + (b * c))) * i;
double tmp;
if (t_2 <= -1e-20) {
tmp = t_1;
} else if (t_2 <= 5e+107) {
tmp = y * (x * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a * (-2.0 * (c * i)) t_2 = (c * (a + (b * c))) * i tmp = 0 if t_2 <= -1e-20: tmp = t_1 elif t_2 <= 5e+107: tmp = y * (x * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a * Float64(-2.0 * Float64(c * i))) t_2 = Float64(Float64(c * Float64(a + Float64(b * c))) * i) tmp = 0.0 if (t_2 <= -1e-20) tmp = t_1; elseif (t_2 <= 5e+107) tmp = Float64(y * Float64(x * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a * (-2.0 * (c * i)); t_2 = (c * (a + (b * c))) * i; tmp = 0.0; if (t_2 <= -1e-20) tmp = t_1; elseif (t_2 <= 5e+107) tmp = y * (x * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(-2.0 * N[(c * i), $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, -1e-20], t$95$1, If[LessEqual[t$95$2, 5e+107], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(-2 \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999945e-21 or 5.0000000000000002e107 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites90.0%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6482.1
Applied rewrites82.1%
Taylor expanded in a around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6439.2
Applied rewrites39.2%
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if -9.99999999999999945e-21 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e107Initial program 99.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
Final simplification46.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= (* x y) -2e+57)
t_1
(if (<= (* x y) 1e-233)
(* t (* z 2.0))
(if (<= (* x y) 5e+77) (* i (* a (* c -2.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 1e-233) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 5e+77) {
tmp = i * (a * (c * -2.0));
} 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 = y * (x * 2.0d0)
if ((x * y) <= (-2d+57)) then
tmp = t_1
else if ((x * y) <= 1d-233) then
tmp = t * (z * 2.0d0)
else if ((x * y) <= 5d+77) then
tmp = i * (a * (c * (-2.0d0)))
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 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 1e-233) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 5e+77) {
tmp = i * (a * (c * -2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = y * (x * 2.0) tmp = 0 if (x * y) <= -2e+57: tmp = t_1 elif (x * y) <= 1e-233: tmp = t * (z * 2.0) elif (x * y) <= 5e+77: tmp = i * (a * (c * -2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (Float64(x * y) <= -2e+57) tmp = t_1; elseif (Float64(x * y) <= 1e-233) tmp = Float64(t * Float64(z * 2.0)); elseif (Float64(x * y) <= 5e+77) tmp = Float64(i * Float64(a * Float64(c * -2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = y * (x * 2.0); tmp = 0.0; if ((x * y) <= -2e+57) tmp = t_1; elseif ((x * y) <= 1e-233) tmp = t * (z * 2.0); elseif ((x * y) <= 5e+77) tmp = i * (a * (c * -2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-233], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(i * N[(a * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-233}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\
\;\;\;\;i \cdot \left(a \cdot \left(c \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
if -2.0000000000000001e57 < (*.f64 x y) < 9.99999999999999958e-234Initial program 88.3%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
if 9.99999999999999958e-234 < (*.f64 x y) < 5.00000000000000004e77Initial program 93.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites94.9%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6472.6
Applied rewrites72.6%
Taylor expanded in a around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6437.8
Applied rewrites37.8%
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-neg.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
lift-*.f6437.2
Applied rewrites37.2%
Final simplification46.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* y (* x 2.0))))
(if (<= (* x y) -2e+57)
t_1
(if (<= (* x y) 5e-137)
(* t (* z 2.0))
(if (<= (* x y) 5e+77) (* c (* a (* i -2.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 5e-137) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 5e+77) {
tmp = c * (a * (i * -2.0));
} 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 = y * (x * 2.0d0)
if ((x * y) <= (-2d+57)) then
tmp = t_1
else if ((x * y) <= 5d-137) then
tmp = t * (z * 2.0d0)
else if ((x * y) <= 5d+77) then
tmp = c * (a * (i * (-2.0d0)))
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 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 5e-137) {
tmp = t * (z * 2.0);
} else if ((x * y) <= 5e+77) {
tmp = c * (a * (i * -2.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = y * (x * 2.0) tmp = 0 if (x * y) <= -2e+57: tmp = t_1 elif (x * y) <= 5e-137: tmp = t * (z * 2.0) elif (x * y) <= 5e+77: tmp = c * (a * (i * -2.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (Float64(x * y) <= -2e+57) tmp = t_1; elseif (Float64(x * y) <= 5e-137) tmp = Float64(t * Float64(z * 2.0)); elseif (Float64(x * y) <= 5e+77) tmp = Float64(c * Float64(a * Float64(i * -2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = y * (x * 2.0); tmp = 0.0; if ((x * y) <= -2e+57) tmp = t_1; elseif ((x * y) <= 5e-137) tmp = t * (z * 2.0); elseif ((x * y) <= 5e+77) tmp = c * (a * (i * -2.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-137], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(c * N[(a * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-137}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\
\;\;\;\;c \cdot \left(a \cdot \left(i \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
if -2.0000000000000001e57 < (*.f64 x y) < 5.00000000000000001e-137Initial program 88.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6436.3
Applied rewrites36.3%
if 5.00000000000000001e-137 < (*.f64 x y) < 5.00000000000000004e77Initial program 94.6%
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-*.f6438.6
Applied rewrites38.6%
Final simplification46.1%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* y (* x 2.0)))) (if (<= (* x y) -2e+57) t_1 (if (<= (* x y) 5e+77) (* t (* z 2.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 5e+77) {
tmp = t * (z * 2.0);
} 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 = y * (x * 2.0d0)
if ((x * y) <= (-2d+57)) then
tmp = t_1
else if ((x * y) <= 5d+77) then
tmp = t * (z * 2.0d0)
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 = y * (x * 2.0);
double tmp;
if ((x * y) <= -2e+57) {
tmp = t_1;
} else if ((x * y) <= 5e+77) {
tmp = t * (z * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = y * (x * 2.0) tmp = 0 if (x * y) <= -2e+57: tmp = t_1 elif (x * y) <= 5e+77: tmp = t * (z * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(y * Float64(x * 2.0)) tmp = 0.0 if (Float64(x * y) <= -2e+57) tmp = t_1; elseif (Float64(x * y) <= 5e+77) tmp = Float64(t * Float64(z * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = y * (x * 2.0); tmp = 0.0; if ((x * y) <= -2e+57) tmp = t_1; elseif ((x * y) <= 5e+77) tmp = t * (z * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+57], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e+77], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+77}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e57 or 5.00000000000000004e77 < (*.f64 x y) Initial program 91.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6458.7
Applied rewrites58.7%
if -2.0000000000000001e57 < (*.f64 x y) < 5.00000000000000004e77Initial program 90.2%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6434.0
Applied rewrites34.0%
Final simplification44.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* -2.0 (* c i)))))
(if (<= a -1.5e+113)
t_1
(if (<= a 3.2e+165) (* 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 * (-2.0 * (c * i));
double tmp;
if (a <= -1.5e+113) {
tmp = t_1;
} else if (a <= 3.2e+165) {
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(-2.0 * Float64(c * i))) tmp = 0.0 if (a <= -1.5e+113) tmp = t_1; elseif (a <= 3.2e+165) 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[(-2.0 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.5e+113], t$95$1, If[LessEqual[a, 3.2e+165], 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(-2 \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;a \leq -1.5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+165}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.5e113 or 3.2e165 < a Initial program 82.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l+N/A
+-commutativeN/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites84.5%
Taylor expanded in z around 0
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f6476.0
Applied rewrites76.0%
Taylor expanded in a around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6465.0
Applied rewrites65.0%
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
*-commutativeN/A
lift-*.f64N/A
neg-mul-1N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6465.0
Applied rewrites65.0%
if -1.5e113 < a < 3.2e165Initial program 93.7%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6459.1
Applied rewrites59.1%
Final simplification60.7%
(FPCore (x y z t a b c i) :precision binary64 (* t (* z 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (z * 2.0);
}
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 * 2.0d0)
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 * 2.0);
}
def code(x, y, z, t, a, b, c, i): return t * (z * 2.0)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(z * 2.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (z * 2.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(z \cdot 2\right)
\end{array}
Initial program 90.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.4
Applied rewrites25.4%
(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 2024214
(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))))