
(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 16 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 (* (fma z t (fma y x (* (- c) (* (fma c b a) i)))) 2.0)))
(if (<= c -5.5e-73)
t_1
(if (<= c 6.5e-163) (* (fma (* (- a) c) i (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 = fma(z, t, fma(y, x, (-c * (fma(c, b, a) * i)))) * 2.0;
double tmp;
if (c <= -5.5e-73) {
tmp = t_1;
} else if (c <= 6.5e-163) {
tmp = fma((-a * c), i, 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(fma(z, t, fma(y, x, Float64(Float64(-c) * Float64(fma(c, b, a) * i)))) * 2.0) tmp = 0.0 if (c <= -5.5e-73) tmp = t_1; elseif (c <= 6.5e-163) tmp = Float64(fma(Float64(Float64(-a) * c), i, 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[(z * t + N[(y * x + N[((-c) * N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[c, -5.5e-73], t$95$1, If[LessEqual[c, 6.5e-163], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \left(-c\right) \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right)\right) \cdot 2\\
\mathbf{if}\;c \leq -5.5 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-163}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(y, x, t \cdot z\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.50000000000000006e-73 or 6.4999999999999999e-163 < c Initial program 90.5%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites97.2%
if -5.50000000000000006e-73 < c < 6.4999999999999999e-163Initial program 93.5%
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-*.f6496.5
Applied rewrites96.5%
Final simplification97.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -2e+88)
t_1
(if (<= t_2 -5e-163)
(* (* t z) 2.0)
(if (<= t_2 1000000000.0) (* (* x y) 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 = ((i * c) * a) * -2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 1000000000.0) {
tmp = (x * y) * 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 = ((i * c) * a) * (-2.0d0)
t_2 = (((b * c) + a) * c) * i
if (t_2 <= (-2d+88)) then
tmp = t_1
else if (t_2 <= (-5d-163)) then
tmp = (t * z) * 2.0d0
else if (t_2 <= 1000000000.0d0) then
tmp = (x * y) * 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 = ((i * c) * a) * -2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 1000000000.0) {
tmp = (x * y) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((i * c) * a) * -2.0 t_2 = (((b * c) + a) * c) * i tmp = 0 if t_2 <= -2e+88: tmp = t_1 elif t_2 <= -5e-163: tmp = (t * z) * 2.0 elif t_2 <= 1000000000.0: tmp = (x * y) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -2e+88) tmp = t_1; elseif (t_2 <= -5e-163) tmp = Float64(Float64(t * z) * 2.0); elseif (t_2 <= 1000000000.0) tmp = Float64(Float64(x * y) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((i * c) * a) * -2.0; t_2 = (((b * c) + a) * c) * i; tmp = 0.0; if (t_2 <= -2e+88) tmp = t_1; elseif (t_2 <= -5e-163) tmp = (t * z) * 2.0; elseif (t_2 <= 1000000000.0) tmp = (x * y) * 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[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], t$95$1, If[LessEqual[t$95$2, -5e-163], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 1000000000.0], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-163}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 1000000000:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e88 or 1e9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 86.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.3
Applied rewrites47.3%
if -1.99999999999999992e88 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999977e-163Initial program 96.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
if -4.99999999999999977e-163 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e9Initial program 98.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Final simplification52.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ (* b c) a) c) i)))
(if (<= t_1 -2e+88)
(* (* (* a i) c) -2.0)
(if (<= t_1 -5e-163)
(* (* t z) 2.0)
(if (<= t_1 1000000000.0) (* (* x y) 2.0) (* (* (* 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+88) {
tmp = ((a * i) * c) * -2.0;
} else if (t_1 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_1 <= 1000000000.0) {
tmp = (x * y) * 2.0;
} else {
tmp = ((a * c) * i) * -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) :: t_1
real(8) :: tmp
t_1 = (((b * c) + a) * c) * i
if (t_1 <= (-2d+88)) then
tmp = ((a * i) * c) * (-2.0d0)
else if (t_1 <= (-5d-163)) then
tmp = (t * z) * 2.0d0
else if (t_1 <= 1000000000.0d0) then
tmp = (x * y) * 2.0d0
else
tmp = ((a * c) * i) * (-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 t_1 = (((b * c) + a) * c) * i;
double tmp;
if (t_1 <= -2e+88) {
tmp = ((a * i) * c) * -2.0;
} else if (t_1 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_1 <= 1000000000.0) {
tmp = (x * y) * 2.0;
} else {
tmp = ((a * c) * i) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((b * c) + a) * c) * i tmp = 0 if t_1 <= -2e+88: tmp = ((a * i) * c) * -2.0 elif t_1 <= -5e-163: tmp = (t * z) * 2.0 elif t_1 <= 1000000000.0: tmp = (x * y) * 2.0 else: tmp = ((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+88) tmp = Float64(Float64(Float64(a * i) * c) * -2.0); elseif (t_1 <= -5e-163) tmp = Float64(Float64(t * z) * 2.0); elseif (t_1 <= 1000000000.0) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(Float64(Float64(a * c) * i) * -2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((b * c) + a) * c) * i; tmp = 0.0; if (t_1 <= -2e+88) tmp = ((a * i) * c) * -2.0; elseif (t_1 <= -5e-163) tmp = (t * z) * 2.0; elseif (t_1 <= 1000000000.0) tmp = (x * y) * 2.0; else tmp = ((a * c) * i) * -2.0; end tmp_2 = 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+88], N[(N[(N[(a * i), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, -5e-163], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 1000000000.0], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(a * 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^{+88}:\\
\;\;\;\;\left(\left(a \cdot i\right) \cdot c\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-163}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_1 \leq 1000000000:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e88Initial program 87.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6453.7
Applied rewrites53.7%
Applied rewrites49.5%
if -1.99999999999999992e88 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999977e-163Initial program 96.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
if -4.99999999999999977e-163 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e9Initial program 98.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
if 1e9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.0
Applied rewrites42.0%
Applied rewrites39.6%
Final simplification50.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* a c) i) -2.0)) (t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -2e+88)
t_1
(if (<= t_2 -5e-163)
(* (* t z) 2.0)
(if (<= t_2 1000000000.0) (* (* x y) 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 * c) * i) * -2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 1000000000.0) {
tmp = (x * y) * 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 * c) * i) * (-2.0d0)
t_2 = (((b * c) + a) * c) * i
if (t_2 <= (-2d+88)) then
tmp = t_1
else if (t_2 <= (-5d-163)) then
tmp = (t * z) * 2.0d0
else if (t_2 <= 1000000000.0d0) then
tmp = (x * y) * 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 * c) * i) * -2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -5e-163) {
tmp = (t * z) * 2.0;
} else if (t_2 <= 1000000000.0) {
tmp = (x * y) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * c) * i) * -2.0 t_2 = (((b * c) + a) * c) * i tmp = 0 if t_2 <= -2e+88: tmp = t_1 elif t_2 <= -5e-163: tmp = (t * z) * 2.0 elif t_2 <= 1000000000.0: tmp = (x * y) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * c) * i) * -2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -2e+88) tmp = t_1; elseif (t_2 <= -5e-163) tmp = Float64(Float64(t * z) * 2.0); elseif (t_2 <= 1000000000.0) tmp = Float64(Float64(x * y) * 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 * c) * i) * -2.0; t_2 = (((b * c) + a) * c) * i; tmp = 0.0; if (t_2 <= -2e+88) tmp = t_1; elseif (t_2 <= -5e-163) tmp = (t * z) * 2.0; elseif (t_2 <= 1000000000.0) tmp = (x * y) * 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[(N[(a * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], t$95$1, If[LessEqual[t$95$2, -5e-163], N[(N[(t * z), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 1000000000.0], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(a \cdot c\right) \cdot i\right) \cdot -2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-163}:\\
\;\;\;\;\left(t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 1000000000:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e88 or 1e9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 86.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6447.3
Applied rewrites47.3%
Applied rewrites44.1%
if -1.99999999999999992e88 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999977e-163Initial program 96.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6451.4
Applied rewrites51.4%
if -4.99999999999999977e-163 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e9Initial program 98.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Final simplification50.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (* (fma b c a) i) (- c) (* x y)) 2.0))
(t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -5e+132)
t_1
(if (<= t_2 2e+118) (* (fma (* (- a) c) i (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 = fma((fma(b, c, a) * i), -c, (x * y)) * 2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -5e+132) {
tmp = t_1;
} else if (t_2 <= 2e+118) {
tmp = fma((-a * c), i, 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(fma(Float64(fma(b, c, a) * i), Float64(-c), Float64(x * y)) * 2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -5e+132) tmp = t_1; elseif (t_2 <= 2e+118) tmp = Float64(fma(Float64(Float64(-a) * c), i, 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[(N[(b * c + a), $MachinePrecision] * i), $MachinePrecision] * (-c) + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+132], t$95$1, If[LessEqual[t$95$2, 2e+118], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right) \cdot i, -c, x \cdot y\right) \cdot 2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(y, x, t \cdot z\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000001e132 or 1.99999999999999993e118 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 85.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6413.8
Applied rewrites13.8%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6486.8
Applied rewrites86.8%
if -5.0000000000000001e132 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999993e118Initial program 97.5%
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-*.f6494.1
Applied rewrites94.1%
Final simplification90.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (- i) (* (fma c b a) c) (* t z)) 2.0))
(t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -1e-107)
t_1
(if (<= t_2 1e-23) (* (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 = fma(-i, (fma(c, b, a) * c), (t * z)) * 2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -1e-107) {
tmp = t_1;
} else if (t_2 <= 1e-23) {
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(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(t * z)) * 2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -1e-107) tmp = t_1; elseif (t_2 <= 1e-23) 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[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-107], t$95$1, If[LessEqual[t$95$2, 1e-23], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, t \cdot z\right) \cdot 2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-23}:\\
\;\;\;\;\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) < -1e-107 or 9.9999999999999996e-24 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 88.6%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6482.0
Applied rewrites82.0%
if -1e-107 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999996e-24Initial program 97.5%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (- i) (* (fma c b a) c) (* x y)) 2.0))
(t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -1e+41) t_1 (if (<= t_2 1e+19) (* (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 = fma(-i, (fma(c, b, a) * c), (x * y)) * 2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -1e+41) {
tmp = t_1;
} else if (t_2 <= 1e+19) {
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(fma(Float64(-i), Float64(fma(c, b, a) * c), Float64(x * y)) * 2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -1e+41) tmp = t_1; elseif (t_2 <= 1e+19) 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[((-i) * N[(N[(c * b + a), $MachinePrecision] * c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+41], t$95$1, If[LessEqual[t$95$2, 1e+19], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, \mathsf{fma}\left(c, b, a\right) \cdot c, x \cdot y\right) \cdot 2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+19}:\\
\;\;\;\;\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.00000000000000001e41 or 1e19 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 87.1%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6480.7
Applied rewrites80.7%
if -1.00000000000000001e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e19Initial program 98.0%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6493.8
Applied rewrites93.8%
Final simplification85.9%
(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 -5e+125)
t_1
(if (<= t_2 1e+112) (* (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 <= -5e+125) {
tmp = t_1;
} else if (t_2 <= 1e+112) {
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 <= -5e+125) tmp = t_1; elseif (t_2 <= 1e+112) 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, -5e+125], t$95$1, If[LessEqual[t$95$2, 1e+112], 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 -5 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+112}:\\
\;\;\;\;\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) < -4.99999999999999962e125 or 9.9999999999999993e111 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 84.8%
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.f6481.3
Applied rewrites81.3%
if -4.99999999999999962e125 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999993e111Initial program 98.3%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Final simplification83.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ (* b c) a) c) i)))
(if (<= t_1 -5e+132)
(* (* (* -2.0 b) (* i c)) c)
(if (<= t_1 1e+298)
(* (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 = (((b * c) + a) * c) * i;
double tmp;
if (t_1 <= -5e+132) {
tmp = ((-2.0 * b) * (i * c)) * c;
} else if (t_1 <= 1e+298) {
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(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_1 <= -5e+132) tmp = Float64(Float64(Float64(-2.0 * b) * Float64(i * c)) * c); elseif (t_1 <= 1e+298) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(Float64(-2.0 * b) * i) * c) * c); 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+132], N[(N[(N[(-2.0 * b), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(-2.0 * b), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision] * c), $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^{+132}:\\
\;\;\;\;\left(\left(-2 \cdot b\right) \cdot \left(i \cdot c\right)\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq 10^{+298}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(-2 \cdot b\right) \cdot i\right) \cdot c\right) \cdot c\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000001e132Initial program 88.1%
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-*.f6460.9
Applied rewrites60.9%
Applied rewrites59.3%
if -5.0000000000000001e132 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999996e297Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.7
Applied rewrites78.7%
if 9.9999999999999996e297 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.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-*.f6458.6
Applied rewrites58.6%
Applied rewrites62.3%
Applied rewrites62.3%
Final simplification71.1%
(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 -5e+132)
t_1
(if (<= t_2 1e+298) (* (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 <= -5e+132) {
tmp = t_1;
} else if (t_2 <= 1e+298) {
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 <= -5e+132) tmp = t_1; elseif (t_2 <= 1e+298) 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, -5e+132], t$95$1, If[LessEqual[t$95$2, 1e+298], 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 -5 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;\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) < -5.0000000000000001e132 or 9.9999999999999996e297 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial 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-*.f6459.8
Applied rewrites59.8%
Applied rewrites60.7%
if -5.0000000000000001e132 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999996e297Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6478.7
Applied rewrites78.7%
Final simplification71.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma c b a) c)) (t_2 (* (+ (* b c) a) c)))
(if (<= t_2 -2e+22)
(* (fma (- i) t_1 (* t z)) 2.0)
(if (<= t_2 5e+111)
(* (fma (* (- a) c) i (fma y x (* t z))) 2.0)
(* (fma (- i) t_1 (* x y)) 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) * c;
double t_2 = ((b * c) + a) * c;
double tmp;
if (t_2 <= -2e+22) {
tmp = fma(-i, t_1, (t * z)) * 2.0;
} else if (t_2 <= 5e+111) {
tmp = fma((-a * c), i, fma(y, x, (t * z))) * 2.0;
} else {
tmp = fma(-i, t_1, (x * y)) * 2.0;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(c, b, a) * c) t_2 = Float64(Float64(Float64(b * c) + a) * c) tmp = 0.0 if (t_2 <= -2e+22) tmp = Float64(fma(Float64(-i), t_1, Float64(t * z)) * 2.0); elseif (t_2 <= 5e+111) tmp = Float64(fma(Float64(Float64(-a) * c), i, fma(y, x, Float64(t * z))) * 2.0); else tmp = Float64(fma(Float64(-i), t_1, Float64(x * y)) * 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] * c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+22], N[(N[((-i) * t$95$1 + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$2, 5e+111], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[((-i) * t$95$1 + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, b, a\right) \cdot c\\
t_2 := \left(b \cdot c + a\right) \cdot c\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(-i, t\_1, t \cdot z\right) \cdot 2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(y, x, t \cdot z\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-i, t\_1, x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -2e22Initial program 86.6%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.0
Applied rewrites84.0%
if -2e22 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.9999999999999997e111Initial program 95.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.9999999999999997e111 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 87.8%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6484.5
Applied rewrites84.5%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (* i c) a) -2.0)) (t_2 (* (* (+ (* b c) a) c) i)))
(if (<= t_2 -2e+153)
t_1
(if (<= t_2 1e+298) (* (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 = ((i * c) * a) * -2.0;
double t_2 = (((b * c) + a) * c) * i;
double tmp;
if (t_2 <= -2e+153) {
tmp = t_1;
} else if (t_2 <= 1e+298) {
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(i * c) * a) * -2.0) t_2 = Float64(Float64(Float64(Float64(b * c) + a) * c) * i) tmp = 0.0 if (t_2 <= -2e+153) tmp = t_1; elseif (t_2 <= 1e+298) 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[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(b * c), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+153], t$95$1, If[LessEqual[t$95$2, 1e+298], 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(i \cdot c\right) \cdot a\right) \cdot -2\\
t_2 := \left(\left(b \cdot c + a\right) \cdot c\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+298}:\\
\;\;\;\;\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) < -2e153 or 9.9999999999999996e297 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 82.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.4
Applied rewrites54.4%
if -2e153 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999996e297Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
Final simplification68.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* b c) a) c)))
(if (<= t_1 -1e+246)
(* (* (* (* -2.0 b) i) c) c)
(if (<= t_1 1e+120)
(* (fma y x (* t z)) 2.0)
(* (* (* -2.0 i) b) (* c c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((b * c) + a) * c;
double tmp;
if (t_1 <= -1e+246) {
tmp = (((-2.0 * b) * i) * c) * c;
} else if (t_1 <= 1e+120) {
tmp = fma(y, x, (t * z)) * 2.0;
} else {
tmp = ((-2.0 * i) * b) * (c * c);
}
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 <= -1e+246) tmp = Float64(Float64(Float64(Float64(-2.0 * b) * i) * c) * c); elseif (t_1 <= 1e+120) tmp = Float64(fma(y, x, Float64(t * z)) * 2.0); else tmp = Float64(Float64(Float64(-2.0 * i) * b) * Float64(c * c)); 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, -1e+246], N[(N[(N[(N[(-2.0 * b), $MachinePrecision] * i), $MachinePrecision] * c), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 1e+120], N[(N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(-2.0 * i), $MachinePrecision] * b), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot c + a\right) \cdot c\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+246}:\\
\;\;\;\;\left(\left(\left(-2 \cdot b\right) \cdot i\right) \cdot c\right) \cdot c\\
\mathbf{elif}\;t\_1 \leq 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-2 \cdot i\right) \cdot b\right) \cdot \left(c \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.00000000000000007e246Initial program 81.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-*.f6458.2
Applied rewrites58.2%
Applied rewrites64.0%
Applied rewrites64.1%
if -1.00000000000000007e246 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.9999999999999998e119Initial program 95.9%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6476.2
Applied rewrites76.2%
if 9.9999999999999998e119 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 87.5%
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-*.f6463.5
Applied rewrites63.5%
Applied rewrites65.2%
Final simplification71.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (fma (* (- c) b) (* i c) (fma y x (* t z))) 2.0)))
(if (<= b -1.7e-58)
t_1
(if (<= b 1.06e-66) (* (fma z t (fma y x (* (* a i) (- 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 = fma((-c * b), (i * c), fma(y, x, (t * z))) * 2.0;
double tmp;
if (b <= -1.7e-58) {
tmp = t_1;
} else if (b <= 1.06e-66) {
tmp = fma(z, t, fma(y, x, ((a * i) * -c))) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(Float64(-c) * b), Float64(i * c), fma(y, x, Float64(t * z))) * 2.0) tmp = 0.0 if (b <= -1.7e-58) tmp = t_1; elseif (b <= 1.06e-66) tmp = Float64(fma(z, t, fma(y, x, Float64(Float64(a * i) * Float64(-c)))) * 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[((-c) * b), $MachinePrecision] * N[(i * c), $MachinePrecision] + N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[b, -1.7e-58], t$95$1, If[LessEqual[b, 1.06e-66], N[(N[(z * t + N[(y * x + N[(N[(a * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(-c\right) \cdot b, i \cdot c, \mathsf{fma}\left(y, x, t \cdot z\right)\right) \cdot 2\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.06 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \left(a \cdot i\right) \cdot \left(-c\right)\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.69999999999999987e-58 or 1.05999999999999994e-66 < b Initial program 91.2%
Taylor expanded in a around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites89.2%
if -1.69999999999999987e-58 < b < 1.05999999999999994e-66Initial program 91.7%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites97.2%
Taylor expanded in c around 0
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* t z) 2.0)))
(if (<= (* t z) -2.5e+37)
t_1
(if (<= (* t z) 2.3e+67) (* (* x y) 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) <= -2.5e+37) {
tmp = t_1;
} else if ((t * z) <= 2.3e+67) {
tmp = (x * y) * 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) <= (-2.5d+37)) then
tmp = t_1
else if ((t * z) <= 2.3d+67) then
tmp = (x * y) * 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) <= -2.5e+37) {
tmp = t_1;
} else if ((t * z) <= 2.3e+67) {
tmp = (x * y) * 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) <= -2.5e+37: tmp = t_1 elif (t * z) <= 2.3e+67: tmp = (x * y) * 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) <= -2.5e+37) tmp = t_1; elseif (Float64(t * z) <= 2.3e+67) tmp = Float64(Float64(x * y) * 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) <= -2.5e+37) tmp = t_1; elseif ((t * z) <= 2.3e+67) tmp = (x * y) * 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], -2.5e+37], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 2.3e+67], N[(N[(x * y), $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 -2.5 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \cdot z \leq 2.3 \cdot 10^{+67}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2.49999999999999994e37 or 2.2999999999999999e67 < (*.f64 z t) Initial program 87.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6453.8
Applied rewrites53.8%
if -2.49999999999999994e37 < (*.f64 z t) < 2.2999999999999999e67Initial program 94.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6440.7
Applied rewrites40.7%
Final simplification46.0%
(FPCore (x y z t a b c i) :precision binary64 (* (* x y) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (x * y) * 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 = (x * y) * 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 (x * y) * 2.0;
}
def code(x, y, z, t, a, b, c, i): return (x * y) * 2.0
function code(x, y, z, t, a, b, c, i) return Float64(Float64(x * y) * 2.0) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (x * y) * 2.0; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y\right) \cdot 2
\end{array}
Initial program 91.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f6430.0
Applied rewrites30.0%
Final simplification30.0%
(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 2024248
(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))))