
(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 13 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 (+ a (* b c))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* b (* (pow c 2.0) (* i -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double tmp;
if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
} else {
tmp = b * (pow(c, 2.0) * (i * -2.0));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i)))); else tmp = Float64(b * Float64((c ^ 2.0) * Float64(i * -2.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[Power[c, 2.0], $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left({c}^{2} \cdot \left(i \cdot -2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.0%
fma-define96.0%
associate-*l*99.1%
Simplified99.1%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define12.5%
*-commutative12.5%
associate-*l*31.3%
+-commutative31.3%
fma-define31.3%
Simplified31.3%
Taylor expanded in c around inf 56.5%
*-commutative56.5%
associate-*l*56.5%
associate-*l*56.5%
Simplified56.5%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* b (* (pow c 2.0) (* i -2.0))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = b * (pow(c, 2.0) * (i * -2.0));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = b * (Math.pow(c, 2.0) * (i * -2.0));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = b * (math.pow(c, 2.0) * (i * -2.0)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(b * Float64((c ^ 2.0) * Float64(i * -2.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = b * ((c ^ 2.0) * (i * -2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[Power[c, 2.0], $MachinePrecision] * N[(i * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left({c}^{2} \cdot \left(i \cdot -2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.0%
fma-define96.0%
associate-*l*99.1%
Simplified99.1%
fma-define99.1%
+-commutative99.1%
Applied egg-rr99.1%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define12.5%
*-commutative12.5%
associate-*l*31.3%
+-commutative31.3%
fma-define31.3%
Simplified31.3%
Taylor expanded in c around inf 56.5%
*-commutative56.5%
associate-*l*56.5%
associate-*l*56.5%
Simplified56.5%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* (* c t_1) i)))
(if (<= t_3 -1e+106)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 1e-18)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* c (* b c)))))
(if (<= t_3 5e+301) (* 2.0 (- (* x y) t_3)) (* -2.0 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -1e+106) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-18) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_3 <= 5e+301) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * 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) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = (c * t_1) * i
if (t_3 <= (-1d+106)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 1d-18) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * (b * c))))
else if (t_3 <= 5d+301) then
tmp = 2.0d0 * ((x * y) - t_3)
else
tmp = (-2.0d0) * 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -1e+106) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-18) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c))));
} else if (t_3 <= 5e+301) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = (c * t_1) * i tmp = 0 if t_3 <= -1e+106: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 1e-18: tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))) elif t_3 <= 5e+301: tmp = 2.0 * ((x * y) - t_3) else: tmp = -2.0 * t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_3 <= -1e+106) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 1e-18) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(b * c))))); elseif (t_3 <= 5e+301) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); else tmp = Float64(-2.0 * t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = (c * t_1) * i; tmp = 0.0; if (t_3 <= -1e+106) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 1e-18) tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * (b * c)))); elseif (t_3 <= 5e+301) tmp = 2.0 * ((x * y) - t_3); else tmp = -2.0 * t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+106], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-18], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+301], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+106}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-18}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106Initial program 81.8%
fma-define81.8%
*-commutative81.8%
associate-*l*89.1%
+-commutative89.1%
fma-define89.1%
Simplified89.1%
Taylor expanded in x around 0 86.9%
if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e-18Initial program 98.3%
Taylor expanded in a around 0 94.2%
*-commutative94.2%
Simplified94.2%
if 1.0000000000000001e-18 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301Initial program 96.1%
Taylor expanded in x around inf 89.1%
if 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.2%
fma-define78.4%
*-commutative78.4%
associate-*l*86.8%
+-commutative86.8%
fma-define86.8%
Simplified86.8%
Taylor expanded in i around inf 93.4%
Final simplification91.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* (* c t_1) i)))
(if (<= t_3 -1e+106)
(* 2.0 (- (* z t) t_2))
(if (<= t_3 1e-18)
(* (+ (* x y) (* z t)) 2.0)
(if (<= t_3 5e+301) (* 2.0 (- (* x y) t_3)) (* -2.0 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -1e+106) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 5e+301) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * 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) :: t_3
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * (t_1 * i)
t_3 = (c * t_1) * i
if (t_3 <= (-1d+106)) then
tmp = 2.0d0 * ((z * t) - t_2)
else if (t_3 <= 1d-18) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (t_3 <= 5d+301) then
tmp = 2.0d0 * ((x * y) - t_3)
else
tmp = (-2.0d0) * 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 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = (c * t_1) * i;
double tmp;
if (t_3 <= -1e+106) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 1e-18) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (t_3 <= 5e+301) {
tmp = 2.0 * ((x * y) - t_3);
} else {
tmp = -2.0 * t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = (c * t_1) * i tmp = 0 if t_3 <= -1e+106: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 1e-18: tmp = ((x * y) + (z * t)) * 2.0 elif t_3 <= 5e+301: tmp = 2.0 * ((x * y) - t_3) else: tmp = -2.0 * t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_3 <= -1e+106) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 1e-18) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (t_3 <= 5e+301) tmp = Float64(2.0 * Float64(Float64(x * y) - t_3)); else tmp = Float64(-2.0 * t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = (c * t_1) * i; tmp = 0.0; if (t_3 <= -1e+106) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 1e-18) tmp = ((x * y) + (z * t)) * 2.0; elseif (t_3 <= 5e+301) tmp = 2.0 * ((x * y) - t_3); else tmp = -2.0 * t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+106], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-18], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$3, 5e+301], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(-2.0 * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+106}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-18}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106Initial program 81.8%
fma-define81.8%
*-commutative81.8%
associate-*l*89.1%
+-commutative89.1%
fma-define89.1%
Simplified89.1%
Taylor expanded in x around 0 86.9%
if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e-18Initial program 98.3%
fma-define99.1%
*-commutative99.1%
associate-*l*98.3%
+-commutative98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 92.6%
if 1.0000000000000001e-18 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301Initial program 96.1%
Taylor expanded in x around inf 89.1%
if 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.2%
fma-define78.4%
*-commutative78.4%
associate-*l*86.8%
+-commutative86.8%
fma-define86.8%
Simplified86.8%
Taylor expanded in i around inf 93.4%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)) (t_3 (* c (* t_1 i))))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* z t) t_3))
(if (<= t_2 5e+301) (* (- (+ (* x y) (* z t)) t_2) 2.0) (* -2.0 t_3)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - t_3);
} else if (t_2 <= 5e+301) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * t_3;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double t_3 = c * (t_1 * i);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - t_3);
} else if (t_2 <= 5e+301) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = -2.0 * t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i t_3 = c * (t_1 * i) tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((z * t) - t_3) elif t_2 <= 5e+301: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = -2.0 * t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) t_3 = Float64(c * Float64(t_1 * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_3)); elseif (t_2 <= 5e+301) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(-2.0 * t_3); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (c * t_1) * i; t_3 = c * (t_1 * i); tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((z * t) - t_3); elseif (t_2 <= 5e+301) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = -2.0 * t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+301], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
t_3 := c \cdot \left(t\_1 \cdot i\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_3\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 75.9%
fma-define75.9%
*-commutative75.9%
associate-*l*91.5%
+-commutative91.5%
fma-define91.6%
Simplified91.6%
Taylor expanded in x around 0 91.7%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301Initial program 98.0%
if 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 76.2%
fma-define78.4%
*-commutative78.4%
associate-*l*86.8%
+-commutative86.8%
fma-define86.8%
Simplified86.8%
Taylor expanded in i around inf 93.4%
Final simplification96.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* x (* 2.0 (+ y (* t (/ z x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = x * (2.0 * (y + (t * (z / x)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(x * Float64(2.0 * Float64(y + Float64(t * Float64(z / x))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = x * (2.0 * (y + (t * (z / x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.0%
fma-define96.0%
associate-*l*99.1%
Simplified99.1%
fma-define99.1%
+-commutative99.1%
Applied egg-rr99.1%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define12.5%
*-commutative12.5%
associate-*l*31.3%
+-commutative31.3%
fma-define31.3%
Simplified31.3%
Taylor expanded in c around 0 37.5%
Taylor expanded in x around inf 50.0%
distribute-lft-out50.0%
associate-/l*56.3%
Simplified56.3%
Final simplification96.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.8e-60) (not (<= c 4.4e-30))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -8.8e-60) || !(c <= 4.4e-30)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 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 ((c <= (-8.8d-60)) .or. (.not. (c <= 4.4d-30))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 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 ((c <= -8.8e-60) || !(c <= 4.4e-30)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -8.8e-60) or not (c <= 4.4e-30): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -8.8e-60) || !(c <= 4.4e-30)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -8.8e-60) || ~((c <= 4.4e-30))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -8.8e-60], N[Not[LessEqual[c, 4.4e-30]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.8 \cdot 10^{-60} \lor \neg \left(c \leq 4.4 \cdot 10^{-30}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -8.7999999999999995e-60 or 4.39999999999999967e-30 < c Initial program 83.8%
fma-define84.5%
*-commutative84.5%
associate-*l*91.7%
+-commutative91.7%
fma-define91.7%
Simplified91.7%
Taylor expanded in x around 0 84.8%
if -8.7999999999999995e-60 < c < 4.39999999999999967e-30Initial program 98.1%
fma-define99.1%
*-commutative99.1%
associate-*l*90.4%
+-commutative90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in c around 0 86.8%
Final simplification85.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* c (* b i))))))
(if (<= c -250000000.0)
t_1
(if (<= c 5.8e-198)
(* 2.0 (* z t))
(if (<= c 1.95e-24) (* 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 = -2.0 * (c * (c * (b * i)));
double tmp;
if (c <= -250000000.0) {
tmp = t_1;
} else if (c <= 5.8e-198) {
tmp = 2.0 * (z * t);
} else if (c <= 1.95e-24) {
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 = (-2.0d0) * (c * (c * (b * i)))
if (c <= (-250000000.0d0)) then
tmp = t_1
else if (c <= 5.8d-198) then
tmp = 2.0d0 * (z * t)
else if (c <= 1.95d-24) 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 = -2.0 * (c * (c * (b * i)));
double tmp;
if (c <= -250000000.0) {
tmp = t_1;
} else if (c <= 5.8e-198) {
tmp = 2.0 * (z * t);
} else if (c <= 1.95e-24) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (c * (b * i))) tmp = 0 if c <= -250000000.0: tmp = t_1 elif c <= 5.8e-198: tmp = 2.0 * (z * t) elif c <= 1.95e-24: tmp = x * (y * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))) tmp = 0.0 if (c <= -250000000.0) tmp = t_1; elseif (c <= 5.8e-198) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 1.95e-24) tmp = Float64(x * Float64(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 = -2.0 * (c * (c * (b * i))); tmp = 0.0; if (c <= -250000000.0) tmp = t_1; elseif (c <= 5.8e-198) tmp = 2.0 * (z * t); elseif (c <= 1.95e-24) 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[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -250000000.0], t$95$1, If[LessEqual[c, 5.8e-198], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.95e-24], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -250000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.8 \cdot 10^{-198}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2.5e8 or 1.95e-24 < c Initial program 82.1%
fma-define82.9%
*-commutative82.9%
associate-*l*91.5%
+-commutative91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in i around inf 76.3%
Taylor expanded in a around 0 60.7%
associate-*r*60.7%
*-commutative60.7%
associate-*l*61.4%
*-commutative61.4%
Simplified61.4%
if -2.5e8 < c < 5.80000000000000001e-198Initial program 98.8%
fma-define98.8%
*-commutative98.8%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in z around inf 50.3%
if 5.80000000000000001e-198 < c < 1.95e-24Initial program 97.3%
fma-define100.0%
*-commutative100.0%
associate-*l*92.0%
+-commutative92.0%
fma-define92.0%
Simplified92.0%
Taylor expanded in x around inf 54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
Final simplification56.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -250000000.0)
t_1
(if (<= c 5.4e-198)
(* 2.0 (* z t))
(if (<= c 4.3e-25) (* 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 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -250000000.0) {
tmp = t_1;
} else if (c <= 5.4e-198) {
tmp = 2.0 * (z * t);
} else if (c <= 4.3e-25) {
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 = (-2.0d0) * (c * (b * (c * i)))
if (c <= (-250000000.0d0)) then
tmp = t_1
else if (c <= 5.4d-198) then
tmp = 2.0d0 * (z * t)
else if (c <= 4.3d-25) 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 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -250000000.0) {
tmp = t_1;
} else if (c <= 5.4e-198) {
tmp = 2.0 * (z * t);
} else if (c <= 4.3e-25) {
tmp = x * (y * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -250000000.0: tmp = t_1 elif c <= 5.4e-198: tmp = 2.0 * (z * t) elif c <= 4.3e-25: tmp = x * (y * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -250000000.0) tmp = t_1; elseif (c <= 5.4e-198) tmp = Float64(2.0 * Float64(z * t)); elseif (c <= 4.3e-25) tmp = Float64(x * Float64(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 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -250000000.0) tmp = t_1; elseif (c <= 5.4e-198) tmp = 2.0 * (z * t); elseif (c <= 4.3e-25) 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[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -250000000.0], t$95$1, If[LessEqual[c, 5.4e-198], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.3e-25], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -250000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.4 \cdot 10^{-198}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;c \leq 4.3 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -2.5e8 or 4.29999999999999976e-25 < c Initial program 82.1%
fma-define82.9%
*-commutative82.9%
associate-*l*91.5%
+-commutative91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in i around inf 76.3%
Taylor expanded in a around 0 60.7%
if -2.5e8 < c < 5.4000000000000003e-198Initial program 98.8%
fma-define98.8%
*-commutative98.8%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in z around inf 50.3%
if 5.4000000000000003e-198 < c < 4.29999999999999976e-25Initial program 97.3%
fma-define100.0%
*-commutative100.0%
associate-*l*92.0%
+-commutative92.0%
fma-define92.0%
Simplified92.0%
Taylor expanded in x around inf 54.6%
*-commutative54.6%
associate-*l*54.6%
Simplified54.6%
Final simplification56.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1000000.0) (not (<= c 7e-6))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1000000.0) || !(c <= 7e-6)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 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 ((c <= (-1000000.0d0)) .or. (.not. (c <= 7d-6))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 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 ((c <= -1000000.0) || !(c <= 7e-6)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1000000.0) or not (c <= 7e-6): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1000000.0) || !(c <= 7e-6)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1000000.0) || ~((c <= 7e-6))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1000000.0], N[Not[LessEqual[c, 7e-6]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1000000 \lor \neg \left(c \leq 7 \cdot 10^{-6}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1e6 or 6.99999999999999989e-6 < c Initial program 81.7%
fma-define82.5%
*-commutative82.5%
associate-*l*91.3%
+-commutative91.3%
fma-define91.3%
Simplified91.3%
Taylor expanded in i around inf 77.3%
if -1e6 < c < 6.99999999999999989e-6Initial program 98.4%
fma-define99.2%
*-commutative99.2%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in c around 0 84.8%
Final simplification81.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.15e+27) (not (<= c 2.5e+17))) (* -2.0 (* c (* c (* b i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.15e+27) || !(c <= 2.5e+17)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = ((x * y) + (z * t)) * 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 ((c <= (-1.15d+27)) .or. (.not. (c <= 2.5d+17))) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else
tmp = ((x * y) + (z * t)) * 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 ((c <= -1.15e+27) || !(c <= 2.5e+17)) {
tmp = -2.0 * (c * (c * (b * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.15e+27) or not (c <= 2.5e+17): tmp = -2.0 * (c * (c * (b * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.15e+27) || !(c <= 2.5e+17)) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.15e+27) || ~((c <= 2.5e+17))) tmp = -2.0 * (c * (c * (b * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.15e+27], N[Not[LessEqual[c, 2.5e+17]], $MachinePrecision]], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.15 \cdot 10^{+27} \lor \neg \left(c \leq 2.5 \cdot 10^{+17}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.15e27 or 2.5e17 < c Initial program 80.0%
fma-define80.9%
*-commutative80.9%
associate-*l*90.5%
+-commutative90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in i around inf 79.4%
Taylor expanded in a around 0 65.2%
associate-*r*65.2%
*-commutative65.2%
associate-*l*66.1%
*-commutative66.1%
Simplified66.1%
if -1.15e27 < c < 2.5e17Initial program 98.5%
fma-define99.2%
*-commutative99.2%
associate-*l*91.7%
+-commutative91.7%
fma-define91.7%
Simplified91.7%
Taylor expanded in c around 0 81.8%
Final simplification74.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -1.42e-80) (not (<= y 520000000.0))) (* x (* y 2.0)) (* 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 ((y <= -1.42e-80) || !(y <= 520000000.0)) {
tmp = x * (y * 2.0);
} 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 ((y <= (-1.42d-80)) .or. (.not. (y <= 520000000.0d0))) then
tmp = x * (y * 2.0d0)
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 ((y <= -1.42e-80) || !(y <= 520000000.0)) {
tmp = x * (y * 2.0);
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -1.42e-80) or not (y <= 520000000.0): tmp = x * (y * 2.0) else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -1.42e-80) || !(y <= 520000000.0)) tmp = Float64(x * Float64(y * 2.0)); 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 ((y <= -1.42e-80) || ~((y <= 520000000.0))) tmp = x * (y * 2.0); else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1.42e-80], N[Not[LessEqual[y, 520000000.0]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{-80} \lor \neg \left(y \leq 520000000\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -1.42000000000000004e-80 or 5.2e8 < y Initial program 87.9%
fma-define89.3%
*-commutative89.3%
associate-*l*91.1%
+-commutative91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in x around inf 43.0%
*-commutative43.0%
associate-*l*43.0%
Simplified43.0%
if -1.42000000000000004e-80 < y < 5.2e8Initial program 92.8%
fma-define92.8%
*-commutative92.8%
associate-*l*91.1%
+-commutative91.1%
fma-define91.2%
Simplified91.2%
Taylor expanded in z around inf 43.6%
Final simplification43.2%
(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 90.0%
fma-define90.8%
*-commutative90.8%
associate-*l*91.1%
+-commutative91.1%
fma-define91.2%
Simplified91.2%
Taylor expanded in z around inf 31.6%
Final simplification31.6%
(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 2024191
(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))))