
(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 12 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 (+ (* t z) (* y x))))
(if (<= c -1.5e-19)
(* (- t_1 (* (* (* (+ (/ a c) b) i) c) c)) 2.0)
(if (<= c 3.05e+122)
(* (- t_1 (* (* (+ (* b c) a) c) i)) 2.0)
(* -2.0 (* (* (fma c b a) i) c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t * z) + (y * x);
double tmp;
if (c <= -1.5e-19) {
tmp = (t_1 - (((((a / c) + b) * i) * c) * c)) * 2.0;
} else if (c <= 3.05e+122) {
tmp = (t_1 - ((((b * c) + a) * c) * i)) * 2.0;
} else {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t * z) + Float64(y * x)) tmp = 0.0 if (c <= -1.5e-19) tmp = Float64(Float64(t_1 - Float64(Float64(Float64(Float64(Float64(a / c) + b) * i) * c) * c)) * 2.0); elseif (c <= 3.05e+122) tmp = Float64(Float64(t_1 - Float64(Float64(Float64(Float64(b * c) + a) * c) * i)) * 2.0); else tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.5e-19], N[(N[(t$95$1 - N[(N[(N[(N[(N[(a / c), $MachinePrecision] + b), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 3.05e+122], N[(N[(t$95$1 - N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot z + y \cdot x\\
\mathbf{if}\;c \leq -1.5 \cdot 10^{-19}:\\
\;\;\;\;\left(t\_1 - \left(\left(\left(\frac{a}{c} + b\right) \cdot i\right) \cdot c\right) \cdot c\right) \cdot 2\\
\mathbf{elif}\;c \leq 3.05 \cdot 10^{+122}:\\
\;\;\;\;\left(t\_1 - \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\end{array}
\end{array}
if c < -1.49999999999999996e-19Initial program 79.4%
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
distribute-lft-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
if -1.49999999999999996e-19 < c < 3.0499999999999999e122Initial program 99.3%
if 3.0499999999999999e122 < c Initial program 77.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.2%
Final simplification96.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ (* b c) a) c) i)))
(if (<= t_1 -2e+195)
(* (* (* -2.0 b) (* i c)) c)
(if (<= t_1 -2e+44)
(* (* (* i c) a) -2.0)
(if (<= t_1 4e+292)
(* (fma y x (* t z)) 2.0)
(* (* (* (* i c) c) -2.0) b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((b * c) + a) * c) * i;
double tmp;
if (t_1 <= -2e+195) {
tmp = ((-2.0 * b) * (i * c)) * c;
} else if (t_1 <= -2e+44) {
tmp = ((i * c) * a) * -2.0;
} else if (t_1 <= 4e+292) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = (((i * c) * c) * -2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_1 <= -2e+195) tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c); elseif (t_1 <= -2e+44) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_1 <= 4e+292) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(Float64(i * c) * c) * -2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+195], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, -2e+44], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 4e+292], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(i * c), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+195}:\\
\;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+44}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot c\right) \cdot -2\right) \cdot b\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999995e195Initial program 82.7%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6469.5
Applied rewrites69.5%
Applied rewrites73.3%
if -1.99999999999999995e195 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e44Initial program 99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.6
Applied rewrites87.6%
if -2.0000000000000002e44 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000001e292Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.8
Applied rewrites80.8%
if 4.0000000000000001e292 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 69.2%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.0
Applied rewrites72.0%
Applied rewrites74.7%
Final simplification78.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* -2.0 b) (* i c)) c)) (t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -2e+195)
t_1
(if (<= t_2 -2e+44)
(* (* (* i c) a) -2.0)
(if (<= t_2 4e+292) (* (fma y x (* 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 = ((-2.0 * b) * (i * c)) * c;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+195) {
tmp = t_1;
} else if (t_2 <= -2e+44) {
tmp = ((i * c) * a) * -2.0;
} else if (t_2 <= 4e+292) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -2e+195) tmp = t_1; elseif (t_2 <= -2e+44) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_2 <= 4e+292) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+195], t$95$1, If[LessEqual[t$95$2, -2e+44], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$2, 4e+292], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+44}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999995e195 or 4.0000000000000001e292 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 78.3%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.3
Applied rewrites70.3%
Applied rewrites72.9%
if -1.99999999999999995e195 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e44Initial program 99.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.6
Applied rewrites87.6%
if -2.0000000000000002e44 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000001e292Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.8
Applied rewrites80.8%
Final simplification77.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* t z) (* y x)) (* (* (+ (* b c) a) c) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* (* (* (* i c) c) -2.0) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((t * z) + (y * x)) - ((((b * c) + a) * c) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = (((i * c) * c) * -2.0) * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((t * z) + (y * x)) - ((((b * c) + a) * c) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = (((i * c) * c) * -2.0) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((t * z) + (y * x)) - ((((b * c) + a) * c) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = (((i * c) * c) * -2.0) * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(t * z) + Float64(y * x)) - Float64(Float64(Float64(Float64(b * c) + a) * c) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(Float64(Float64(Float64(i * c) * c) * -2.0) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((t * z) + (y * x)) - ((((b * c) + a) * c) * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 * 2.0; else tmp = (((i * c) * c) * -2.0) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(N[(N[(N[(i * c), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z + y \cdot x\right) - \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(i \cdot c\right) \cdot c\right) \cdot -2\right) \cdot b\\
\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.2%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6466.7
Applied rewrites66.7%
Applied rewrites66.7%
Final simplification93.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* b c) a) c)))
(if (<= t_1 -4e+231)
(* (* (* -2.0 b) (* i c)) c)
(if (<= t_1 -2e+67)
(* (* (* i c) a) -2.0)
(if (<= t_1 5e+300)
(* (fma y x (* t z)) 2.0)
(* (* -2.0 i) (* (* c c) b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((b * c) + a) * c;
double tmp;
if (t_1 <= -4e+231) {
tmp = ((-2.0 * b) * (i * c)) * c;
} else if (t_1 <= -2e+67) {
tmp = ((i * c) * a) * -2.0;
} else if (t_1 <= 5e+300) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = (-2.0 * i) * ((c * c) * b);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(b * c) + a) * c) tmp = 0.0 if (t_1 <= -4e+231) tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c); elseif (t_1 <= -2e+67) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (t_1 <= 5e+300) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(-2.0 * i) * Float64(Float64(c * c) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+231], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, -2e+67], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+300], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(-2.0 * i), $MachinePrecision] * N[(N[(c * c), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot c + a\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+231}:\\
\;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+67}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot i\right) \cdot \left(\left(c \cdot c\right) \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -4.0000000000000002e231Initial program 73.2%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.3
Applied rewrites73.3%
Applied rewrites80.6%
if -4.0000000000000002e231 < (*.f64 (+.f64 a (*.f64 b c)) c) < -1.99999999999999997e67Initial program 99.6%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.1
Applied rewrites58.1%
if -1.99999999999999997e67 < (*.f64 (+.f64 a (*.f64 b c)) c) < 5.00000000000000026e300Initial program 99.2%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.3
Applied rewrites78.3%
if 5.00000000000000026e300 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 78.7%
Taylor expanded in c around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.1
Applied rewrites81.1%
Applied rewrites83.5%
Final simplification77.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ (* b c) a) c) i)))
(if (<= t_1 -5e+151)
(* -2.0 (* (* (fma c b a) i) c))
(if (<= t_1 4e+148)
(* (fma (* (- a) c) i (fma y x (* t z))) 2.0)
(* (* (* (fma c b a) 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 = (((b * c) + a) * c) * i;
double tmp;
if (t_1 <= -5e+151) {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
} else if (t_1 <= 4e+148) {
tmp = fma((-a * c), i, fma(y, x, (t * z))) * 2.0;
} else {
tmp = ((fma(c, b, a) * c) * -i) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_1 <= -5e+151) tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); elseif (t_1 <= 4e+148) tmp = Float64(fma(Float64(Float64(-a) * c), i, fma(y, x, Float64(t * z))) * 2.0); else tmp = Float64(Float64(Float64(fma(c, b, a) * c) * Float64(-i)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+151], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+148], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * (-i)), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+151}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(y, x, t \cdot z\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot \left(-i\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000002e151Initial program 82.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.7
Applied rewrites89.7%
if -5.0000000000000002e151 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000002e148Initial program 99.9%
Taylor expanded in c around 0
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6495.4
Applied rewrites95.4%
if 4.0000000000000002e148 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.0%
Taylor expanded in i around inf
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6473.2
Applied rewrites73.2%
Final simplification89.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ (* b c) a) c) i)))
(if (<= t_1 -2e+44)
(* -2.0 (* (* (fma c b a) i) c))
(if (<= t_1 4e+148)
(* (fma y x (* t z)) 2.0)
(* (* (* (fma c b a) 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 = (((b * c) + a) * c) * i;
double tmp;
if (t_1 <= -2e+44) {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
} else if (t_1 <= 4e+148) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = ((fma(c, b, a) * c) * -i) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_1 <= -2e+44) tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); elseif (t_1 <= 4e+148) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(fma(c, b, a) * c) * Float64(-i)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+44], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+148], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * (-i)), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+44}:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot \left(-i\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e44Initial program 84.3%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.1
Applied rewrites88.1%
if -2.0000000000000002e44 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000002e148Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.7
Applied rewrites86.7%
if 4.0000000000000002e148 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.0%
Taylor expanded in i around inf
mul-1-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6473.2
Applied rewrites73.2%
Final simplification84.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* (* (fma c b a) i) c))) (t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -2e+44)
t_1
(if (<= t_2 4e+148) (* (fma y x (* 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 = -2.0 * ((fma(c, b, a) * i) * c);
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+44) {
tmp = t_1;
} else if (t_2 <= 4e+148) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -2e+44) tmp = t_1; elseif (t_2 <= 4e+148) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); 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[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+44], t$95$1, If[LessEqual[t$95$2, 4e+148], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e44 or 4.0000000000000002e148 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6479.6
Applied rewrites79.6%
if -2.0000000000000002e44 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000002e148Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6486.7
Applied rewrites86.7%
Final simplification82.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* t z) 2.0)))
(if (<= (* t z) -1.75e+89)
t_1
(if (<= (* t z) -3.1e-111)
(* (* (* i c) a) -2.0)
(if (<= (* t z) 1.08e+49) (* (* 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 = (t * z) * 2.0;
double tmp;
if ((t * z) <= -1.75e+89) {
tmp = t_1;
} else if ((t * z) <= -3.1e-111) {
tmp = ((i * c) * a) * -2.0;
} else if ((t * z) <= 1.08e+49) {
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) :: tmp
t_1 = (t * z) * 2.0d0
if ((t * z) <= (-1.75d+89)) then
tmp = t_1
else if ((t * z) <= (-3.1d-111)) then
tmp = ((i * c) * a) * (-2.0d0)
else if ((t * z) <= 1.08d+49) 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 = (t * z) * 2.0;
double tmp;
if ((t * z) <= -1.75e+89) {
tmp = t_1;
} else if ((t * z) <= -3.1e-111) {
tmp = ((i * c) * a) * -2.0;
} else if ((t * z) <= 1.08e+49) {
tmp = (y * x) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (t * z) * 2.0 tmp = 0 if (t * z) <= -1.75e+89: tmp = t_1 elif (t * z) <= -3.1e-111: tmp = ((i * c) * a) * -2.0 elif (t * z) <= 1.08e+49: tmp = (y * x) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t * z) * 2.0) tmp = 0.0 if (Float64(t * z) <= -1.75e+89) tmp = t_1; elseif (Float64(t * z) <= -3.1e-111) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); elseif (Float64(t * z) <= 1.08e+49) tmp = Float64(Float64(y * 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 = (t * z) * 2.0; tmp = 0.0; if ((t * z) <= -1.75e+89) tmp = t_1; elseif ((t * z) <= -3.1e-111) tmp = ((i * c) * a) * -2.0; elseif ((t * z) <= 1.08e+49) 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[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -1.75e+89], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], -3.1e-111], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1.08e+49], N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 2\\
\mathbf{if}\;t \cdot z \leq -1.75 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq -3.1 \cdot 10^{-111}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{elif}\;t \cdot z \leq 1.08 \cdot 10^{+49}:\\
\;\;\;\;\left(y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.75e89 or 1.08000000000000001e49 < (*.f64 z t) Initial program 90.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6460.7
Applied rewrites60.7%
if -1.75e89 < (*.f64 z t) < -3.10000000000000014e-111Initial program 88.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.4
Applied rewrites37.4%
if -3.10000000000000014e-111 < (*.f64 z t) < 1.08000000000000001e49Initial program 91.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6444.7
Applied rewrites44.7%
Final simplification49.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* (* (+ (* b c) a) c) i) -2e+44) (* (* (* i c) a) -2.0) (* (fma y x (* t z)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((((b * c) + a) * c) * i) <= -2e+44) {
tmp = ((i * c) * a) * -2.0;
} else {
tmp = fma(y, x, (t * z)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(b * c) + a) * c) * i) <= -2e+44) tmp = Float64(Float64(Float64(i * c) * a) * -2.0); else tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision], -2e+44], N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(b \cdot c + a\right) \cdot c\right) \cdot i \leq -2 \cdot 10^{+44}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000002e44Initial program 84.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.0
Applied rewrites37.0%
if -2.0000000000000002e44 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 93.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6470.1
Applied rewrites70.1%
Final simplification59.6%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (* y x) 2.0))) (if (<= (* y x) -1e+40) t_1 (if (<= (* y x) 2e-12) (* (* 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 ((y * x) <= -1e+40) {
tmp = t_1;
} else if ((y * x) <= 2e-12) {
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 ((y * x) <= (-1d+40)) then
tmp = t_1
else if ((y * x) <= 2d-12) 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 ((y * x) <= -1e+40) {
tmp = t_1;
} else if ((y * x) <= 2e-12) {
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 (y * x) <= -1e+40: tmp = t_1 elif (y * x) <= 2e-12: tmp = (t * z) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * x) * 2.0) tmp = 0.0 if (Float64(y * x) <= -1e+40) tmp = t_1; elseif (Float64(y * x) <= 2e-12) tmp = Float64(Float64(t * 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 ((y * x) <= -1e+40) tmp = t_1; elseif ((y * x) <= 2e-12) 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[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(y * x), $MachinePrecision], -1e+40], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e-12], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot 2\\
\mathbf{if}\;y \cdot x \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000003e40 or 1.99999999999999996e-12 < (*.f64 x y) Initial program 87.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6455.2
Applied rewrites55.2%
if -1.00000000000000003e40 < (*.f64 x y) < 1.99999999999999996e-12Initial program 93.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6440.3
Applied rewrites40.3%
Final simplification47.3%
(FPCore (x y z t a b c i) :precision binary64 (* (* y x) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * x) * 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 = (y * x) * 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 (y * x) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (y * x) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * x) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * x) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot x\right) \cdot 2
\end{array}
Initial program 90.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6430.2
Applied rewrites30.2%
Final simplification30.2%
(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 2024235
(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))))