
(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
(let* ((t_1 (- (+ (* t z) (* y x)) (* i (* (+ (* c b) a) c)))))
(if (<= t_1 4e+303)
(* 2.0 t_1)
(fma (* 2.0 y) x (* (fma t z (* (- c) (* (fma c b a) i))) 2.0)))))
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)) - (i * (((c * b) + a) * c));
double tmp;
if (t_1 <= 4e+303) {
tmp = 2.0 * t_1;
} else {
tmp = fma((2.0 * y), x, (fma(t, z, (-c * (fma(c, b, a) * i))) * 2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(t * z) + Float64(y * x)) - Float64(i * Float64(Float64(Float64(c * b) + a) * c))) tmp = 0.0 if (t_1 <= 4e+303) tmp = Float64(2.0 * t_1); else tmp = fma(Float64(2.0 * y), x, Float64(fma(t, z, Float64(Float64(-c) * Float64(fma(c, b, a) * i))) * 2.0)); end return 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[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+303], N[(2.0 * t$95$1), $MachinePrecision], N[(N[(2.0 * y), $MachinePrecision] * x + N[(N[(t * z + N[((-c) * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot z + y \cdot x\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot y, x, \mathsf{fma}\left(t, z, \left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot 2\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < 4e303Initial program 96.7%
if 4e303 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 79.0%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
distribute-lft-inN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites96.2%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 (- INFINITY))
(* -2.0 (* (* (fma c b a) i) c))
(if (or (<= t_1 -2e+40) (not (<= t_1 2e+70)))
(* (fma (- i) (* (fma c b a) c) (* y x)) 2.0)
(fma (* 2.0 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 t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
} else if ((t_1 <= -2e+40) || !(t_1 <= 2e+70)) {
tmp = fma(-i, (fma(c, b, a) * c), (y * x)) * 2.0;
} else {
tmp = fma((2.0 * y), x, ((t * z) * 2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); elseif ((t_1 <= -2e+40) || !(t_1 <= 2e+70)) tmp = Float64(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(y * x)) * 2.0); else tmp = fma(Float64(2.0 * y), x, Float64(Float64(t * z) * 2.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e+40], N[Not[LessEqual[t$95$1, 2e+70]], $MachinePrecision]], N[(N[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(2.0 * y), $MachinePrecision] * x + N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+40} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+70}\right):\\
\;\;\;\;\mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot y, x, \left(t \cdot z\right) \cdot 2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 79.2%
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.f6494.2
Applied rewrites94.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000006e40 or 2.00000000000000015e70 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 88.2%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
*-commutativeN/A
*-commutativeN/A
distribute-neg-inN/A
Applied rewrites82.4%
if -2.00000000000000006e40 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.00000000000000015e70Initial program 99.9%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
distribute-lft-inN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites100.0%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f6489.5
Applied rewrites89.5%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) i)) (t_2 (* i (* (+ (* c b) a) c))))
(if (<= t_2 (- INFINITY))
(* -2.0 (* t_1 c))
(if (<= t_2 2e+288)
(* 2.0 (- (+ (* t z) (* y x)) t_2))
(* (fma t_1 (- c) (fma t z (* y x))) 2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, b, a) * i;
double t_2 = i * (((c * b) + a) * c);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = -2.0 * (t_1 * c);
} else if (t_2 <= 2e+288) {
tmp = 2.0 * (((t * z) + (y * x)) - t_2);
} else {
tmp = fma(t_1, -c, fma(t, z, (y * x))) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * i) t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(-2.0 * Float64(t_1 * c)); elseif (t_2 <= 2e+288) tmp = Float64(2.0 * Float64(Float64(Float64(t * z) + Float64(y * x)) - t_2)); else tmp = Float64(fma(t_1, Float64(-c), fma(t, z, Float64(y * x))) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(-2.0 * N[(t$95$1 * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+288], N[(2.0 * N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * (-c) + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot i\\
t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;-2 \cdot \left(t\_1 \cdot c\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;2 \cdot \left(\left(t \cdot z + y \cdot x\right) - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -c, \mathsf{fma}\left(t, z, y \cdot x\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 79.2%
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.f6494.2
Applied rewrites94.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e288Initial program 99.8%
if 2e288 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 77.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites88.7%
Final simplification96.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (- (+ (* t z) (* y x)) (* i (* (+ (* c b) a) c))) INFINITY) (* (fma (* (fma c b a) i) (- c) (fma t z (* y x))) 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 tmp;
if ((((t * z) + (y * x)) - (i * (((c * b) + a) * c))) <= ((double) INFINITY)) {
tmp = fma((fma(c, b, a) * i), -c, fma(t, z, (y * x))) * 2.0;
} else {
tmp = (-2.0 * i) * ((c * c) * b);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(t * z) + Float64(y * x)) - Float64(i * Float64(Float64(Float64(c * b) + a) * c))) <= Inf) tmp = Float64(fma(Float64(fma(c, b, a) * i), Float64(-c), fma(t, z, Float64(y * x))) * 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_] := If[LessEqual[N[(N[(N[(t * z), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] - N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * (-c) + N[(t * z + N[(y * x), $MachinePrecision]), $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}
\mathbf{if}\;\left(t \cdot z + y \cdot x\right) - i \cdot \left(\left(c \cdot b + a\right) \cdot c\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(c, b, a\right) \cdot i, -c, \mathsf{fma}\left(t, z, y \cdot x\right)\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 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.0
Applied rewrites94.1%
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-*.f6469.5
Applied rewrites69.5%
Applied rewrites69.5%
Final simplification92.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (or (<= t_1 -4e+84) (not (<= t_1 5e+159)))
(* (* (* (fma c b a) c) (- i)) 2.0)
(fma (* 2.0 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 t_1 = i * (((c * b) + a) * c);
double tmp;
if ((t_1 <= -4e+84) || !(t_1 <= 5e+159)) {
tmp = ((fma(c, b, a) * c) * -i) * 2.0;
} else {
tmp = fma((2.0 * y), x, ((t * z) * 2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if ((t_1 <= -4e+84) || !(t_1 <= 5e+159)) tmp = Float64(Float64(Float64(fma(c, b, a) * c) * Float64(-i)) * 2.0); else tmp = fma(Float64(2.0 * y), x, Float64(Float64(t * z) * 2.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+84], N[Not[LessEqual[t$95$1, 5e+159]], $MachinePrecision]], N[(N[(N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] * (-i)), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(2.0 * y), $MachinePrecision] * x + N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+159}\right):\\
\;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot \left(-i\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot y, x, \left(t \cdot z\right) \cdot 2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000023e84 or 5.00000000000000003e159 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.8%
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.f6483.8
Applied rewrites83.8%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000003e159Initial program 99.9%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
distribute-lft-inN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites98.4%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f6484.2
Applied rewrites84.2%
Final simplification84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (or (<= t_1 -4e+84) (not (<= t_1 5e+168)))
(* -2.0 (* (* (fma c b a) i) c))
(fma (* 2.0 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 t_1 = i * (((c * b) + a) * c);
double tmp;
if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
} else {
tmp = fma((2.0 * y), x, ((t * z) * 2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); else tmp = fma(Float64(2.0 * y), x, Float64(Float64(t * z) * 2.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+84], N[Not[LessEqual[t$95$1, 5e+168]], $MachinePrecision]], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * y), $MachinePrecision] * x + N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+168}\right):\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2 \cdot y, x, \left(t \cdot z\right) \cdot 2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000023e84 or 4.99999999999999967e168 < (*.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.f6482.2
Applied rewrites82.2%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
distribute-lft-inN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites97.6%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
Final simplification82.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (or (<= t_1 -4e+84) (not (<= t_1 5e+168)))
(* -2.0 (* (* (fma c b a) i) c))
(* (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 t_1 = i * (((c * b) + a) * c);
double tmp;
if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) {
tmp = -2.0 * ((fma(c, b, a) * i) * c);
} else {
tmp = fma(y, x, (t * z)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) tmp = Float64(-2.0 * Float64(Float64(fma(c, b, a) * i) * c)); else tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+84], N[Not[LessEqual[t$95$1, 5e+168]], $MachinePrecision]], N[(-2.0 * N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+168}\right):\\
\;\;\;\;-2 \cdot \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot c\right)\\
\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) < -4.00000000000000023e84 or 4.99999999999999967e168 < (*.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.f6482.2
Applied rewrites82.2%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
Final simplification82.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (or (<= t_1 -4e+84) (not (<= t_1 5e+168)))
(* (* (* -2.0 b) (* i c)) c)
(* (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 t_1 = i * (((c * b) + a) * c);
double tmp;
if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) {
tmp = ((-2.0 * b) * (i * c)) * c;
} else {
tmp = fma(y, x, (t * z)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if ((t_1 <= -4e+84) || !(t_1 <= 5e+168)) tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c); else tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+84], N[Not[LessEqual[t$95$1, 5e+168]], $MachinePrecision]], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+168}\right):\\
\;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
\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) < -4.00000000000000023e84 or 4.99999999999999967e168 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.6%
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-*.f6467.2
Applied rewrites67.2%
Applied rewrites66.5%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
Final simplification75.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -4e+84)
(* (* (* -2.0 i) c) (* c b))
(if (<= t_1 5e+168)
(* (fma y x (* t z)) 2.0)
(* (* (* (* c c) i) -2.0) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -4e+84) {
tmp = ((-2.0 * i) * c) * (c * b);
} else if (t_1 <= 5e+168) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = (((c * c) * i) * -2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -4e+84) tmp = Float64(Float64(Float64(-2.0 * i) * c) * Float64(c * b)); elseif (t_1 <= 5e+168) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(Float64(c * c) * i) * -2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+84], N[(N[(N[(-2.0 * i), $MachinePrecision] * c), $MachinePrecision] * N[(c * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+168], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84}:\\
\;\;\;\;\left(\left(-2 \cdot i\right) \cdot c\right) \cdot \left(c \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(c \cdot c\right) \cdot i\right) \cdot -2\right) \cdot b\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000023e84Initial program 84.4%
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.1
Applied rewrites69.1%
Applied rewrites67.8%
Applied rewrites71.9%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
if 4.99999999999999967e168 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.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-*.f6465.0
Applied rewrites65.0%
Final simplification76.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -4e+84)
(* (* (* -2.0 i) c) (* c b))
(if (<= t_1 5e+168)
(* (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 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -4e+84) {
tmp = ((-2.0 * i) * c) * (c * b);
} else if (t_1 <= 5e+168) {
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(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -4e+84) tmp = Float64(Float64(Float64(-2.0 * i) * c) * Float64(c * b)); elseif (t_1 <= 5e+168) 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[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+84], N[(N[(N[(-2.0 * i), $MachinePrecision] * c), $MachinePrecision] * N[(c * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+168], 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 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84}:\\
\;\;\;\;\left(\left(-2 \cdot i\right) \cdot c\right) \cdot \left(c \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+168}:\\
\;\;\;\;\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 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000023e84Initial program 84.4%
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.1
Applied rewrites69.1%
Applied rewrites67.8%
Applied rewrites71.9%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
if 4.99999999999999967e168 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.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-*.f6465.0
Applied rewrites65.0%
Applied rewrites62.0%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (<= t_1 -4e+84)
(* (* (* -2.0 i) c) (* c b))
(if (<= t_1 5e+168)
(* (fma y x (* t z)) 2.0)
(* (* (* -2.0 b) (* i c)) c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (((c * b) + a) * c);
double tmp;
if (t_1 <= -4e+84) {
tmp = ((-2.0 * i) * c) * (c * b);
} else if (t_1 <= 5e+168) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = ((-2.0 * b) * (i * c)) * c;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if (t_1 <= -4e+84) tmp = Float64(Float64(Float64(-2.0 * i) * c) * Float64(c * b)); elseif (t_1 <= 5e+168) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+84], N[(N[(N[(-2.0 * i), $MachinePrecision] * c), $MachinePrecision] * N[(c * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+168], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84}:\\
\;\;\;\;\left(\left(-2 \cdot i\right) \cdot c\right) \cdot \left(c \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000023e84Initial program 84.4%
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.1
Applied rewrites69.1%
Applied rewrites67.8%
Applied rewrites71.9%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.99999999999999967e168Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6483.7
Applied rewrites83.7%
if 4.99999999999999967e168 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 80.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-*.f6465.0
Applied rewrites65.0%
Applied rewrites61.8%
Final simplification75.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* (+ (* c b) a) c))))
(if (or (<= t_1 -4e+84) (not (<= t_1 2e+293)))
(* (* (* 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 t_1 = i * (((c * b) + a) * c);
double tmp;
if ((t_1 <= -4e+84) || !(t_1 <= 2e+293)) {
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) t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c)) tmp = 0.0 if ((t_1 <= -4e+84) || !(t_1 <= 2e+293)) 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_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+84], N[Not[LessEqual[t$95$1, 2e+293]], $MachinePrecision]], 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}
t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+84} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+293}\right):\\
\;\;\;\;\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) < -4.00000000000000023e84 or 1.9999999999999998e293 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 81.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
if -4.00000000000000023e84 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999998e293Initial program 99.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.5
Applied rewrites80.5%
Final simplification63.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* y x) 2.0)))
(if (<= (* y x) -5e+116)
t_1
(if (<= (* y x) 2e+59)
(* (* t z) 2.0)
(if (<= (* y x) 4e+109) (* (* (* i c) a) -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) <= -5e+116) {
tmp = t_1;
} else if ((y * x) <= 2e+59) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 4e+109) {
tmp = ((i * c) * a) * -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) <= (-5d+116)) then
tmp = t_1
else if ((y * x) <= 2d+59) then
tmp = (t * z) * 2.0d0
else if ((y * x) <= 4d+109) then
tmp = ((i * c) * a) * (-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) <= -5e+116) {
tmp = t_1;
} else if ((y * x) <= 2e+59) {
tmp = (t * z) * 2.0;
} else if ((y * x) <= 4e+109) {
tmp = ((i * c) * a) * -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) <= -5e+116: tmp = t_1 elif (y * x) <= 2e+59: tmp = (t * z) * 2.0 elif (y * x) <= 4e+109: tmp = ((i * c) * a) * -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) <= -5e+116) tmp = t_1; elseif (Float64(y * x) <= 2e+59) tmp = Float64(Float64(t * z) * 2.0); elseif (Float64(y * x) <= 4e+109) tmp = Float64(Float64(Float64(i * c) * a) * -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) <= -5e+116) tmp = t_1; elseif ((y * x) <= 2e+59) tmp = (t * z) * 2.0; elseif ((y * x) <= 4e+109) tmp = ((i * c) * a) * -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], -5e+116], t$95$1, If[LessEqual[N[(y * x), $MachinePrecision], 2e+59], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 4e+109], N[(N[(N[(i * c), $MachinePrecision] * a), $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 -5 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot x \leq 2 \cdot 10^{+59}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;y \cdot x \leq 4 \cdot 10^{+109}:\\
\;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000025e116 or 3.99999999999999993e109 < (*.f64 x y) Initial program 87.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
if -5.00000000000000025e116 < (*.f64 x y) < 1.99999999999999994e59Initial program 92.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
if 1.99999999999999994e59 < (*.f64 x y) < 3.99999999999999993e109Initial program 93.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.4
Applied rewrites60.4%
Final simplification47.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* y x) -5e+116) (not (<= (* y x) 1e+60))) (* (* y x) 2.0) (* (* 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 (((y * x) <= -5e+116) || !((y * x) <= 1e+60)) {
tmp = (y * x) * 2.0;
} else {
tmp = (t * z) * 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 (((y * x) <= (-5d+116)) .or. (.not. ((y * x) <= 1d+60))) then
tmp = (y * x) * 2.0d0
else
tmp = (t * z) * 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 (((y * x) <= -5e+116) || !((y * x) <= 1e+60)) {
tmp = (y * x) * 2.0;
} else {
tmp = (t * z) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((y * x) <= -5e+116) or not ((y * x) <= 1e+60): tmp = (y * x) * 2.0 else: tmp = (t * z) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(y * x) <= -5e+116) || !(Float64(y * x) <= 1e+60)) tmp = Float64(Float64(y * x) * 2.0); else tmp = Float64(Float64(t * z) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((y * x) <= -5e+116) || ~(((y * x) <= 1e+60))) tmp = (y * x) * 2.0; else tmp = (t * z) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(y * x), $MachinePrecision], -5e+116], N[Not[LessEqual[N[(y * x), $MachinePrecision], 1e+60]], $MachinePrecision]], N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot x \leq -5 \cdot 10^{+116} \lor \neg \left(y \cdot x \leq 10^{+60}\right):\\
\;\;\;\;\left(y \cdot x\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.00000000000000025e116 or 9.9999999999999995e59 < (*.f64 x y) Initial program 89.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6455.6
Applied rewrites55.6%
if -5.00000000000000025e116 < (*.f64 x y) < 9.9999999999999995e59Initial program 92.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Final simplification45.2%
(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 91.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6425.2
Applied rewrites25.2%
Final simplification25.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 2024271
(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))))