
(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 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 95.0%
fma-define95.4%
associate-*l*97.2%
Simplified97.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* x y) (* c (* b (* c i))))))
(t_2 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -3.2e+150)
t_2
(if (<= c -102000000000.0)
t_1
(if (<= c 1.7e-80)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 6.4e+124) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((x * y) - (c * (b * (c * i))));
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -3.2e+150) {
tmp = t_2;
} else if (c <= -102000000000.0) {
tmp = t_1;
} else if (c <= 1.7e-80) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 6.4e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 2.0d0 * ((x * y) - (c * (b * (c * i))))
t_2 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-3.2d+150)) then
tmp = t_2
else if (c <= (-102000000000.0d0)) then
tmp = t_1
else if (c <= 1.7d-80) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 6.4d+124) then
tmp = t_1
else
tmp = t_2
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 = 2.0 * ((x * y) - (c * (b * (c * i))));
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -3.2e+150) {
tmp = t_2;
} else if (c <= -102000000000.0) {
tmp = t_1;
} else if (c <= 1.7e-80) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 6.4e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((x * y) - (c * (b * (c * i)))) t_2 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -3.2e+150: tmp = t_2 elif c <= -102000000000.0: tmp = t_1 elif c <= 1.7e-80: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 6.4e+124: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))) t_2 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -3.2e+150) tmp = t_2; elseif (c <= -102000000000.0) tmp = t_1; elseif (c <= 1.7e-80) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 6.4e+124) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((x * y) - (c * (b * (c * i)))); t_2 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -3.2e+150) tmp = t_2; elseif (c <= -102000000000.0) tmp = t_1; elseif (c <= 1.7e-80) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 6.4e+124) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.2e+150], t$95$2, If[LessEqual[c, -102000000000.0], t$95$1, If[LessEqual[c, 1.7e-80], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.4e+124], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
t_2 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{+150}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq -102000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.7 \cdot 10^{-80}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 6.4 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -3.20000000000000016e150 or 6.39999999999999986e124 < c Initial program 91.2%
fma-define91.2%
associate-*l*98.4%
Simplified98.4%
fma-define98.4%
+-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in c around 0 93.8%
Taylor expanded in i around inf 86.4%
associate-*r*86.4%
neg-mul-186.4%
distribute-rgt-in84.9%
associate-*r*81.8%
+-commutative81.8%
*-commutative81.8%
fma-undefine81.8%
*-commutative81.8%
fma-undefine81.8%
*-commutative81.8%
+-commutative81.8%
associate-*r*84.9%
distribute-rgt-in86.4%
*-commutative86.4%
Simplified86.4%
if -3.20000000000000016e150 < c < -1.02e11 or 1.7e-80 < c < 6.39999999999999986e124Initial program 94.0%
fma-define94.0%
associate-*l*95.1%
Simplified95.1%
fma-define95.1%
+-commutative95.1%
Applied egg-rr95.1%
Taylor expanded in c around 0 89.2%
Taylor expanded in z around 0 74.5%
associate-*r*74.6%
distribute-rgt-in78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in a around 0 70.9%
if -1.02e11 < c < 1.7e-80Initial program 98.1%
Taylor expanded in c around 0 72.4%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= (* x y) -4.7e+70)
t_2
(if (<= (* x y) -6e-133)
t_1
(if (<= (* x y) -1.95e-264)
(* 2.0 (* i (- (* a c))))
(if (<= (* x y) 4.1e+34) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -4.7e+70) {
tmp = t_2;
} else if ((x * y) <= -6e-133) {
tmp = t_1;
} else if ((x * y) <= -1.95e-264) {
tmp = 2.0 * (i * -(a * c));
} else if ((x * y) <= 4.1e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if ((x * y) <= (-4.7d+70)) then
tmp = t_2
else if ((x * y) <= (-6d-133)) then
tmp = t_1
else if ((x * y) <= (-1.95d-264)) then
tmp = 2.0d0 * (i * -(a * c))
else if ((x * y) <= 4.1d+34) then
tmp = t_1
else
tmp = t_2
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 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -4.7e+70) {
tmp = t_2;
} else if ((x * y) <= -6e-133) {
tmp = t_1;
} else if ((x * y) <= -1.95e-264) {
tmp = 2.0 * (i * -(a * c));
} else if ((x * y) <= 4.1e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if (x * y) <= -4.7e+70: tmp = t_2 elif (x * y) <= -6e-133: tmp = t_1 elif (x * y) <= -1.95e-264: tmp = 2.0 * (i * -(a * c)) elif (x * y) <= 4.1e+34: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -4.7e+70) tmp = t_2; elseif (Float64(x * y) <= -6e-133) tmp = t_1; elseif (Float64(x * y) <= -1.95e-264) tmp = Float64(2.0 * Float64(i * Float64(-Float64(a * c)))); elseif (Float64(x * y) <= 4.1e+34) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -4.7e+70) tmp = t_2; elseif ((x * y) <= -6e-133) tmp = t_1; elseif ((x * y) <= -1.95e-264) tmp = 2.0 * (i * -(a * c)); elseif ((x * y) <= 4.1e+34) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.7e+70], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -6e-133], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.95e-264], N[(2.0 * N[(i * (-N[(a * c), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.1e+34], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -4.7 \cdot 10^{+70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-264}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(-a \cdot c\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.6999999999999998e70 or 4.0999999999999998e34 < (*.f64 x y) Initial program 93.7%
Taylor expanded in x around inf 57.6%
if -4.6999999999999998e70 < (*.f64 x y) < -6.00000000000000038e-133 or -1.9499999999999999e-264 < (*.f64 x y) < 4.0999999999999998e34Initial program 95.4%
Taylor expanded in z around inf 39.2%
if -6.00000000000000038e-133 < (*.f64 x y) < -1.9499999999999999e-264Initial program 99.7%
fma-define99.8%
associate-*l*99.8%
Simplified99.8%
fma-define99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 42.3%
mul-1-neg42.3%
associate-*r*42.3%
distribute-rgt-neg-in42.3%
*-commutative42.3%
Simplified42.3%
Final simplification47.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* 2.0 (* x y))))
(if (<= (* x y) -3.2e+71)
t_2
(if (<= (* x y) -1.25e-132)
t_1
(if (<= (* x y) -1.1e-269)
(* a (* (* c i) -2.0))
(if (<= (* x y) 1.36e+34) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -3.2e+71) {
tmp = t_2;
} else if ((x * y) <= -1.25e-132) {
tmp = t_1;
} else if ((x * y) <= -1.1e-269) {
tmp = a * ((c * i) * -2.0);
} else if ((x * y) <= 1.36e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 2.0d0 * (z * t)
t_2 = 2.0d0 * (x * y)
if ((x * y) <= (-3.2d+71)) then
tmp = t_2
else if ((x * y) <= (-1.25d-132)) then
tmp = t_1
else if ((x * y) <= (-1.1d-269)) then
tmp = a * ((c * i) * (-2.0d0))
else if ((x * y) <= 1.36d+34) then
tmp = t_1
else
tmp = t_2
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 = 2.0 * (z * t);
double t_2 = 2.0 * (x * y);
double tmp;
if ((x * y) <= -3.2e+71) {
tmp = t_2;
} else if ((x * y) <= -1.25e-132) {
tmp = t_1;
} else if ((x * y) <= -1.1e-269) {
tmp = a * ((c * i) * -2.0);
} else if ((x * y) <= 1.36e+34) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = 2.0 * (x * y) tmp = 0 if (x * y) <= -3.2e+71: tmp = t_2 elif (x * y) <= -1.25e-132: tmp = t_1 elif (x * y) <= -1.1e-269: tmp = a * ((c * i) * -2.0) elif (x * y) <= 1.36e+34: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(2.0 * Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.2e+71) tmp = t_2; elseif (Float64(x * y) <= -1.25e-132) tmp = t_1; elseif (Float64(x * y) <= -1.1e-269) tmp = Float64(a * Float64(Float64(c * i) * -2.0)); elseif (Float64(x * y) <= 1.36e+34) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = 2.0 * (x * y); tmp = 0.0; if ((x * y) <= -3.2e+71) tmp = t_2; elseif ((x * y) <= -1.25e-132) tmp = t_1; elseif ((x * y) <= -1.1e-269) tmp = a * ((c * i) * -2.0); elseif ((x * y) <= 1.36e+34) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.2e+71], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.25e-132], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.1e-269], N[(a * N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.36e+34], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-269}:\\
\;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\
\mathbf{elif}\;x \cdot y \leq 1.36 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.20000000000000023e71 or 1.36e34 < (*.f64 x y) Initial program 93.7%
Taylor expanded in x around inf 57.6%
if -3.20000000000000023e71 < (*.f64 x y) < -1.25e-132 or -1.09999999999999992e-269 < (*.f64 x y) < 1.36e34Initial program 95.4%
Taylor expanded in z around inf 39.2%
if -1.25e-132 < (*.f64 x y) < -1.09999999999999992e-269Initial program 99.7%
fma-define99.8%
associate-*l*99.8%
Simplified99.8%
fma-define99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 42.3%
mul-1-neg42.3%
associate-*r*42.3%
distribute-rgt-neg-in42.3%
*-commutative42.3%
Simplified42.3%
Taylor expanded in c around 0 42.3%
*-commutative42.3%
associate-*l*42.3%
Simplified42.3%
Final simplification47.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -3.2e+66)
t_1
(if (<= c 4.1e-126)
(* 2.0 (+ (* x y) (* z t)))
(if (<= c 3e-15)
(* 2.0 (- (* x y) (* a (* c i))))
(if (<= c 5.9e-15) (* 2.0 (* z t)) 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 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -3.2e+66) {
tmp = t_1;
} else if (c <= 4.1e-126) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 3e-15) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if (c <= 5.9e-15) {
tmp = 2.0 * (z * t);
} 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 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-3.2d+66)) then
tmp = t_1
else if (c <= 4.1d-126) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (c <= 3d-15) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else if (c <= 5.9d-15) then
tmp = 2.0d0 * (z * t)
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 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -3.2e+66) {
tmp = t_1;
} else if (c <= 4.1e-126) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (c <= 3e-15) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if (c <= 5.9e-15) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -3.2e+66: tmp = t_1 elif c <= 4.1e-126: tmp = 2.0 * ((x * y) + (z * t)) elif c <= 3e-15: tmp = 2.0 * ((x * y) - (a * (c * i))) elif c <= 5.9e-15: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -3.2e+66) tmp = t_1; elseif (c <= 4.1e-126) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (c <= 3e-15) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); elseif (c <= 5.9e-15) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (c * ((a + (b * c)) * -i)); tmp = 0.0; if (c <= -3.2e+66) tmp = t_1; elseif (c <= 4.1e-126) tmp = 2.0 * ((x * y) + (z * t)); elseif (c <= 3e-15) tmp = 2.0 * ((x * y) - (a * (c * i))); elseif (c <= 5.9e-15) tmp = 2.0 * (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.2e+66], t$95$1, If[LessEqual[c, 4.1e-126], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3e-15], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.9e-15], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 4.1 \cdot 10^{-126}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-15}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 5.9 \cdot 10^{-15}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -3.2e66 or 5.89999999999999963e-15 < c Initial program 90.8%
fma-define90.8%
associate-*l*96.5%
Simplified96.5%
fma-define96.5%
+-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in c around 0 92.9%
Taylor expanded in i around inf 74.8%
associate-*r*74.8%
neg-mul-174.8%
distribute-rgt-in72.2%
associate-*r*72.0%
+-commutative72.0%
*-commutative72.0%
fma-undefine72.9%
*-commutative72.9%
fma-undefine72.0%
*-commutative72.0%
+-commutative72.0%
associate-*r*72.2%
distribute-rgt-in74.8%
*-commutative74.8%
Simplified74.8%
if -3.2e66 < c < 4.0999999999999997e-126Initial program 98.2%
Taylor expanded in c around 0 72.4%
if 4.0999999999999997e-126 < c < 3e-15Initial program 99.8%
Taylor expanded in a around inf 84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in z around 0 77.4%
if 3e-15 < c < 5.89999999999999963e-15Initial program 100.0%
Taylor expanded in z around inf 100.0%
Final simplification74.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= b -7.5e+25) (not (<= b 15500000000.0)))
(* 2.0 (- t_1 (* c (* b (* c i)))))
(* 2.0 (- t_1 (* i (* a c)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((b <= -7.5e+25) || !(b <= 15500000000.0)) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else {
tmp = 2.0 * (t_1 - (i * (a * c)));
}
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 = (x * y) + (z * t)
if ((b <= (-7.5d+25)) .or. (.not. (b <= 15500000000.0d0))) then
tmp = 2.0d0 * (t_1 - (c * (b * (c * i))))
else
tmp = 2.0d0 * (t_1 - (i * (a * c)))
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 = (x * y) + (z * t);
double tmp;
if ((b <= -7.5e+25) || !(b <= 15500000000.0)) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else {
tmp = 2.0 * (t_1 - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (b <= -7.5e+25) or not (b <= 15500000000.0): tmp = 2.0 * (t_1 - (c * (b * (c * i)))) else: tmp = 2.0 * (t_1 - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((b <= -7.5e+25) || !(b <= 15500000000.0)) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); else tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((b <= -7.5e+25) || ~((b <= 15500000000.0))) tmp = 2.0 * (t_1 - (c * (b * (c * i)))); else tmp = 2.0 * (t_1 - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -7.5e+25], N[Not[LessEqual[b, 15500000000.0]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;b \leq -7.5 \cdot 10^{+25} \lor \neg \left(b \leq 15500000000\right):\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if b < -7.49999999999999993e25 or 1.55e10 < b Initial program 93.2%
fma-define93.2%
associate-*l*97.3%
Simplified97.3%
fma-define97.3%
+-commutative97.3%
Applied egg-rr97.3%
Taylor expanded in c around 0 92.0%
Taylor expanded in a around 0 91.1%
if -7.49999999999999993e25 < b < 1.55e10Initial program 96.5%
Taylor expanded in a around inf 87.4%
*-commutative87.4%
Simplified87.4%
Final simplification89.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6e+17) (not (<= c 1.7e+49))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6e+17) || !(c <= 1.7e+49)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
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 ((c <= (-6d+17)) .or. (.not. (c <= 1.7d+49))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
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 ((c <= -6e+17) || !(c <= 1.7e+49)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6e+17) or not (c <= 1.7e+49): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6e+17) || !(c <= 1.7e+49)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6e+17) || ~((c <= 1.7e+49))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6e+17], N[Not[LessEqual[c, 1.7e+49]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6 \cdot 10^{+17} \lor \neg \left(c \leq 1.7 \cdot 10^{+49}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -6e17 or 1.7e49 < c Initial program 90.1%
Taylor expanded in z around 0 86.7%
if -6e17 < c < 1.7e49Initial program 98.6%
Taylor expanded in a around inf 86.6%
*-commutative86.6%
Simplified86.6%
Final simplification86.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.3e-107) (not (<= c 3e-129))) (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.3e-107) || !(c <= 3e-129)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
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 ((c <= (-2.3d-107)) .or. (.not. (c <= 3d-129))) then
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
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 ((c <= -2.3e-107) || !(c <= 3e-129)) {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.3e-107) or not (c <= 3e-129): tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.3e-107) || !(c <= 3e-129)) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.3e-107) || ~((c <= 3e-129))) tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.3e-107], N[Not[LessEqual[c, 3e-129]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.3 \cdot 10^{-107} \lor \neg \left(c \leq 3 \cdot 10^{-129}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -2.30000000000000003e-107 or 2.9999999999999998e-129 < c Initial program 93.6%
Taylor expanded in z around 0 81.2%
if -2.30000000000000003e-107 < c < 2.9999999999999998e-129Initial program 98.6%
Taylor expanded in c around 0 77.1%
Final simplification80.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* c i))))
(if (or (<= (* x y) -5e+71) (not (<= (* x y) 1e+34)))
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) 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);
double tmp;
if (((x * y) <= -5e+71) || !((x * y) <= 1e+34)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - 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 = a * (c * i)
if (((x * y) <= (-5d+71)) .or. (.not. ((x * y) <= 1d+34))) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - 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);
double tmp;
if (((x * y) <= -5e+71) || !((x * y) <= 1e+34)) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a * (c * i) tmp = 0 if ((x * y) <= -5e+71) or not ((x * y) <= 1e+34): tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a * Float64(c * i)) tmp = 0.0 if ((Float64(x * y) <= -5e+71) || !(Float64(x * y) <= 1e+34)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a * (c * i); tmp = 0.0; if (((x * y) <= -5e+71) || ~(((x * y) <= 1e+34))) tmp = 2.0 * ((x * y) - t_1); else tmp = 2.0 * ((z * t) - t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+71], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+34]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+71} \lor \neg \left(x \cdot y \leq 10^{+34}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999972e71 or 9.99999999999999946e33 < (*.f64 x y) Initial program 93.7%
Taylor expanded in a around inf 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in z around 0 73.9%
if -4.99999999999999972e71 < (*.f64 x y) < 9.99999999999999946e33Initial program 96.0%
Taylor expanded in a around inf 62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in x around 0 58.9%
Final simplification65.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e-97)
(* 2.0 (+ (* x y) (* z t)))
(if (<= (* x y) 1e-23)
(* 2.0 (- (* z t) (* a (* c i))))
(* 2.0 (* y (+ x (/ (* z t) y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e-97) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= 1e-23) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + ((z * t) / y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-1d-97)) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if ((x * y) <= 1d-23) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else
tmp = 2.0d0 * (y * (x + ((z * t) / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1e-97) {
tmp = 2.0 * ((x * y) + (z * t));
} else if ((x * y) <= 1e-23) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else {
tmp = 2.0 * (y * (x + ((z * t) / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e-97: tmp = 2.0 * ((x * y) + (z * t)) elif (x * y) <= 1e-23: tmp = 2.0 * ((z * t) - (a * (c * i))) else: tmp = 2.0 * (y * (x + ((z * t) / y))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e-97) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (Float64(x * y) <= 1e-23) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x + Float64(Float64(z * t) / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1e-97) tmp = 2.0 * ((x * y) + (z * t)); elseif ((x * y) <= 1e-23) tmp = 2.0 * ((z * t) - (a * (c * i))); else tmp = 2.0 * (y * (x + ((z * t) / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e-97], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-23], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-97}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-23}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x + \frac{z \cdot t}{y}\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e-97Initial program 95.9%
Taylor expanded in c around 0 64.9%
if -1.00000000000000004e-97 < (*.f64 x y) < 9.9999999999999996e-24Initial program 98.1%
Taylor expanded in a around inf 63.6%
*-commutative63.6%
Simplified63.6%
Taylor expanded in x around 0 61.8%
if 9.9999999999999996e-24 < (*.f64 x y) Initial program 90.1%
fma-define91.4%
associate-*l*93.8%
Simplified93.8%
fma-define92.5%
+-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in c around 0 88.8%
Taylor expanded in y around inf 86.6%
Taylor expanded in c around 0 63.9%
Final simplification63.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2.3e+70) (not (<= (* x y) 5.9e+33))) (* 2.0 (* x y)) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2.3e+70) || !((x * y) <= 5.9e+33)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-2.3d+70)) .or. (.not. ((x * y) <= 5.9d+33))) then
tmp = 2.0d0 * (x * y)
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2.3e+70) || !((x * y) <= 5.9e+33)) {
tmp = 2.0 * (x * y);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2.3e+70) or not ((x * y) <= 5.9e+33): tmp = 2.0 * (x * y) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2.3e+70) || !(Float64(x * y) <= 5.9e+33)) tmp = Float64(2.0 * Float64(x * y)); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2.3e+70) || ~(((x * y) <= 5.9e+33))) tmp = 2.0 * (x * y); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.3e+70], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.9e+33]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 5.9 \cdot 10^{+33}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.29999999999999994e70 or 5.90000000000000008e33 < (*.f64 x y) Initial program 93.7%
Taylor expanded in x around inf 57.6%
if -2.29999999999999994e70 < (*.f64 x y) < 5.90000000000000008e33Initial program 96.0%
Taylor expanded in z around inf 36.0%
Final simplification45.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -7.2e+179) (* 2.0 (* i (- (* a c)))) (if (<= a 2.65e+271) (* 2.0 (+ (* x y) (* z t))) (* a (* (* c i) -2.0)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -7.2e+179) {
tmp = 2.0 * (i * -(a * c));
} else if (a <= 2.65e+271) {
tmp = 2.0 * ((x * y) + (z * t));
} 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) :: tmp
if (a <= (-7.2d+179)) then
tmp = 2.0d0 * (i * -(a * c))
else if (a <= 2.65d+271) then
tmp = 2.0d0 * ((x * y) + (z * t))
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 tmp;
if (a <= -7.2e+179) {
tmp = 2.0 * (i * -(a * c));
} else if (a <= 2.65e+271) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = a * ((c * i) * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -7.2e+179: tmp = 2.0 * (i * -(a * c)) elif a <= 2.65e+271: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = a * ((c * i) * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -7.2e+179) tmp = Float64(2.0 * Float64(i * Float64(-Float64(a * c)))); elseif (a <= 2.65e+271) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(a * Float64(Float64(c * i) * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -7.2e+179) tmp = 2.0 * (i * -(a * c)); elseif (a <= 2.65e+271) tmp = 2.0 * ((x * y) + (z * t)); else tmp = a * ((c * i) * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -7.2e+179], N[(2.0 * N[(i * (-N[(a * c), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.65e+271], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(c * i), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+179}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(-a \cdot c\right)\right)\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+271}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\
\end{array}
\end{array}
if a < -7.1999999999999995e179Initial program 94.2%
fma-define94.2%
associate-*l*96.9%
Simplified96.9%
fma-define96.9%
+-commutative96.9%
Applied egg-rr96.9%
Taylor expanded in a around inf 63.6%
mul-1-neg63.6%
associate-*r*63.7%
distribute-rgt-neg-in63.7%
*-commutative63.7%
Simplified63.7%
if -7.1999999999999995e179 < a < 2.6500000000000001e271Initial program 95.3%
Taylor expanded in c around 0 58.1%
if 2.6500000000000001e271 < a Initial program 91.9%
fma-define91.9%
associate-*l*99.9%
Simplified99.9%
fma-define99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 90.5%
mul-1-neg90.5%
associate-*r*82.5%
distribute-rgt-neg-in82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in c around 0 90.5%
*-commutative90.5%
associate-*l*90.5%
Simplified90.5%
Final simplification60.3%
(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}
Initial program 95.0%
fma-define95.4%
associate-*l*97.2%
Simplified97.2%
fma-define96.8%
+-commutative96.8%
Applied egg-rr96.8%
Final simplification96.8%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* i (* c (+ a (* b c)))))))
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)) - (i * (c * (a + (b * c)))));
}
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)) - (i * (c * (a + (b * c)))))
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)) - (i * (c * (a + (b * c)))));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (i * (c * (a + (b * c)))))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(a + Float64(b * c)))))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (a + (b * c))))); 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[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)
\end{array}
Initial program 95.0%
Final simplification95.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
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 * (z * t)
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 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 95.0%
Taylor expanded in z around inf 27.1%
Final simplification27.1%
(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 2024089
(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
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))