
(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))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* i (* c t_1))) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* t (* 2.0 (+ z (* x (/ y t))))))))
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 - (i * (c * t_1))) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
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 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
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 - (i * (c * t_1))) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = t * (2.0 * (z + (x * (y / t)))) 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(i * Float64(c * t_1))) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(t * Float64(2.0 * Float64(z + Float64(x * Float64(y / t))))); 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 - (i * (c * t_1))) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = t * (2.0 * (z + (x * (y / t)))); 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(2.0 * N[(z + N[(x * N[(y / t), $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 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\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.2%
fma-define96.2%
associate-*l*98.8%
Simplified98.8%
fma-define98.8%
+-commutative98.8%
Applied egg-rr98.8%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define12.5%
*-commutative12.5%
associate-*l*25.0%
+-commutative25.0%
fma-define25.0%
Simplified25.0%
Taylor expanded in c around 0 37.5%
Taylor expanded in t around inf 50.0%
distribute-lft-out50.0%
associate-/l*62.5%
Simplified62.5%
Final simplification97.6%
(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 93.2%
fma-define93.5%
associate-*l*96.5%
Simplified96.5%
(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 (* i (* c t_1))))
(if (<= t_3 (- INFINITY))
(* -2.0 t_2)
(if (<= t_3 4e+162)
(* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))
(* 2.0 (- (* z t) 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 = i * (c * t_1);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = -2.0 * t_2;
} else if (t_3 <= 4e+162) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
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 = i * (c * t_1);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = -2.0 * t_2;
} else if (t_3 <= 4e+162) {
tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - 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 = i * (c * t_1) tmp = 0 if t_3 <= -math.inf: tmp = -2.0 * t_2 elif t_3 <= 4e+162: tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))) else: tmp = 2.0 * ((z * t) - 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(i * Float64(c * t_1)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(-2.0 * t_2); elseif (t_3 <= 4e+162) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - 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 = i * (c * t_1); tmp = 0.0; if (t_3 <= -Inf) tmp = -2.0 * t_2; elseif (t_3 <= 4e+162) tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i))); else tmp = 2.0 * ((z * t) - 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(-2.0 * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 4e+162], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $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 := i \cdot \left(c \cdot t\_1\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;-2 \cdot t\_2\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+162}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 82.6%
associate--l+82.6%
*-commutative82.6%
associate--l+82.6%
associate--l+82.6%
*-commutative82.6%
associate--l+82.6%
fma-define82.6%
*-commutative82.6%
associate-*l*91.0%
+-commutative91.0%
fma-define91.0%
Simplified91.0%
Taylor expanded in i around inf 89.5%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.9999999999999998e162Initial program 98.0%
Taylor expanded in a around inf 91.7%
if 3.9999999999999998e162 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 89.9%
associate--l+89.9%
*-commutative89.9%
associate--l+89.9%
associate--l+89.9%
*-commutative89.9%
associate--l+89.9%
fma-define89.9%
*-commutative89.9%
associate-*l*97.8%
+-commutative97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around 0 94.0%
Final simplification91.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (<= t_2 -5e+166)
(* 2.0 (- (* x y) t_2))
(if (<= t_2 4e+41)
(* 2.0 (+ (* x y) (* z t)))
(* 2.0 (- (* z t) (* c (* t_1 i))))))))
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 = i * (c * t_1);
double tmp;
if (t_2 <= -5e+166) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_2 <= 4e+41) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = i * (c * t_1)
if (t_2 <= (-5d+166)) then
tmp = 2.0d0 * ((x * y) - t_2)
else if (t_2 <= 4d+41) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = 2.0d0 * ((z * t) - (c * (t_1 * i)))
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 = i * (c * t_1);
double tmp;
if (t_2 <= -5e+166) {
tmp = 2.0 * ((x * y) - t_2);
} else if (t_2 <= 4e+41) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if t_2 <= -5e+166: tmp = 2.0 * ((x * y) - t_2) elif t_2 <= 4e+41: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = 2.0 * ((z * t) - (c * (t_1 * i))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if (t_2 <= -5e+166) tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); elseif (t_2 <= 4e+41) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); tmp = 0.0; if (t_2 <= -5e+166) tmp = 2.0 * ((x * y) - t_2); elseif (t_2 <= 4e+41) tmp = 2.0 * ((x * y) + (z * t)); else tmp = 2.0 * ((z * t) - (c * (t_1 * i))); 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[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+166], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+41], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t\_1\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+166}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+41}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000002e166Initial program 85.5%
Taylor expanded in x around inf 84.9%
if -5.0000000000000002e166 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.00000000000000002e41Initial program 97.6%
associate--l+97.6%
*-commutative97.6%
associate--l+97.6%
associate--l+97.6%
*-commutative97.6%
associate--l+97.6%
fma-define98.4%
*-commutative98.4%
associate-*l*97.6%
+-commutative97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in c around 0 88.5%
if 4.00000000000000002e41 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 92.5%
associate--l+92.5%
*-commutative92.5%
associate--l+92.5%
associate--l+92.5%
*-commutative92.5%
associate--l+92.5%
fma-define92.5%
*-commutative92.5%
associate-*l*95.4%
+-commutative95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in x around 0 86.7%
Final simplification87.1%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* i (* c (+ a (* b c))))))) (if (<= t_1 INFINITY) (* 2.0 t_1) (* t (* 2.0 (+ z (* x (/ y t))))))))
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)) - (i * (c * (a + (b * c))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = 2.0 * t_1;
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
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 = ((x * y) + (z * t)) - (i * (c * (a + (b * c))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * t_1;
} else {
tmp = t * (2.0 * (z + (x * (y / t))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) - (i * (c * (a + (b * c)))) tmp = 0 if t_1 <= math.inf: tmp = 2.0 * t_1 else: tmp = t * (2.0 * (z + (x * (y / t)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(a + Float64(b * c))))) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(2.0 * t_1); else tmp = Float64(t * Float64(2.0 * Float64(z + Float64(x * Float64(y / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) - (i * (c * (a + (b * c)))); tmp = 0.0; if (t_1 <= Inf) tmp = 2.0 * t_1; else tmp = t * (2.0 * (z + (x * (y / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, Infinity], N[(2.0 * t$95$1), $MachinePrecision], N[(t * N[(2.0 * N[(z + N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(2 \cdot \left(z + x \cdot \frac{y}{t}\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.2%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
associate--l+0.0%
*-commutative0.0%
associate--l+0.0%
fma-define12.5%
*-commutative12.5%
associate-*l*25.0%
+-commutative25.0%
fma-define25.0%
Simplified25.0%
Taylor expanded in c around 0 37.5%
Taylor expanded in t around inf 50.0%
distribute-lft-out50.0%
associate-/l*62.5%
Simplified62.5%
Final simplification95.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (* 2.0 y))))
(if (<= c -16500000000.0)
(* -2.0 (* c (* c (* b i))))
(if (<= c -4.465e-63)
(* -2.0 (* i (* a c)))
(if (<= c 1.55e-213)
t_1
(if (<= c 1.75e-12)
(* t (* 2.0 z))
(if (<= c 6e+67) t_1 (* -2.0 (* c (* (* b c) i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (2.0 * y);
double tmp;
if (c <= -16500000000.0) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= -4.465e-63) {
tmp = -2.0 * (i * (a * c));
} else if (c <= 1.55e-213) {
tmp = t_1;
} else if (c <= 1.75e-12) {
tmp = t * (2.0 * z);
} else if (c <= 6e+67) {
tmp = t_1;
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
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 * (2.0d0 * y)
if (c <= (-16500000000.0d0)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= (-4.465d-63)) then
tmp = (-2.0d0) * (i * (a * c))
else if (c <= 1.55d-213) then
tmp = t_1
else if (c <= 1.75d-12) then
tmp = t * (2.0d0 * z)
else if (c <= 6d+67) then
tmp = t_1
else
tmp = (-2.0d0) * (c * ((b * c) * i))
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 * (2.0 * y);
double tmp;
if (c <= -16500000000.0) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= -4.465e-63) {
tmp = -2.0 * (i * (a * c));
} else if (c <= 1.55e-213) {
tmp = t_1;
} else if (c <= 1.75e-12) {
tmp = t * (2.0 * z);
} else if (c <= 6e+67) {
tmp = t_1;
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x * (2.0 * y) tmp = 0 if c <= -16500000000.0: tmp = -2.0 * (c * (c * (b * i))) elif c <= -4.465e-63: tmp = -2.0 * (i * (a * c)) elif c <= 1.55e-213: tmp = t_1 elif c <= 1.75e-12: tmp = t * (2.0 * z) elif c <= 6e+67: tmp = t_1 else: tmp = -2.0 * (c * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(2.0 * y)) tmp = 0.0 if (c <= -16500000000.0) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= -4.465e-63) tmp = Float64(-2.0 * Float64(i * Float64(a * c))); elseif (c <= 1.55e-213) tmp = t_1; elseif (c <= 1.75e-12) tmp = Float64(t * Float64(2.0 * z)); elseif (c <= 6e+67) tmp = t_1; else tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x * (2.0 * y); tmp = 0.0; if (c <= -16500000000.0) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= -4.465e-63) tmp = -2.0 * (i * (a * c)); elseif (c <= 1.55e-213) tmp = t_1; elseif (c <= 1.75e-12) tmp = t * (2.0 * z); elseif (c <= 6e+67) tmp = t_1; else tmp = -2.0 * (c * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -16500000000.0], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4.465e-63], N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.55e-213], t$95$1, If[LessEqual[c, 1.75e-12], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6e+67], t$95$1, N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(2 \cdot y\right)\\
\mathbf{if}\;c \leq -16500000000:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq -4.465 \cdot 10^{-63}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{elif}\;c \leq 6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.65e10Initial program 91.2%
associate--l+91.2%
*-commutative91.2%
associate--l+91.2%
associate--l+91.2%
*-commutative91.2%
associate--l+91.2%
fma-define91.2%
*-commutative91.2%
associate-*l*94.6%
+-commutative94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in i around inf 84.0%
Taylor expanded in a around 0 70.6%
associate-*r*68.9%
*-commutative68.9%
associate-*l*70.6%
*-commutative70.6%
Simplified70.6%
if -1.65e10 < c < -4.465e-63Initial program 99.8%
Taylor expanded in a around inf 99.7%
Taylor expanded in a around inf 50.9%
associate-*r*51.0%
*-commutative51.0%
Simplified51.0%
if -4.465e-63 < c < 1.5499999999999999e-213 or 1.75e-12 < c < 6.0000000000000002e67Initial program 95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
fma-define97.3%
*-commutative97.3%
associate-*l*92.1%
+-commutative92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in x around inf 52.9%
*-commutative52.9%
associate-*l*52.9%
Simplified52.9%
if 1.5499999999999999e-213 < c < 1.75e-12Initial program 98.2%
associate--l+98.2%
*-commutative98.2%
associate--l+98.2%
associate--l+98.2%
*-commutative98.2%
associate--l+98.2%
fma-define98.3%
*-commutative98.3%
associate-*l*96.7%
+-commutative96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in z around inf 50.9%
associate-*r*50.9%
*-commutative50.9%
associate-*l*50.9%
*-commutative50.9%
Simplified50.9%
if 6.0000000000000002e67 < c Initial program 83.9%
associate--l+83.9%
*-commutative83.9%
associate--l+83.9%
associate--l+83.9%
*-commutative83.9%
associate--l+83.9%
fma-define83.9%
*-commutative83.9%
associate-*l*94.3%
+-commutative94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in i around inf 81.9%
Taylor expanded in a around 0 65.6%
*-commutative65.6%
Simplified65.6%
Final simplification58.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* c (* b i))))) (t_2 (* x (* 2.0 y))))
(if (<= c -11500000000.0)
t_1
(if (<= c -4.465e-63)
(* -2.0 (* i (* a c)))
(if (<= c 2.2e-215)
t_2
(if (<= c 2.4e-13) (* t (* 2.0 z)) (if (<= c 9.2e+67) t_2 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 t_2 = x * (2.0 * y);
double tmp;
if (c <= -11500000000.0) {
tmp = t_1;
} else if (c <= -4.465e-63) {
tmp = -2.0 * (i * (a * c));
} else if (c <= 2.2e-215) {
tmp = t_2;
} else if (c <= 2.4e-13) {
tmp = t * (2.0 * z);
} else if (c <= 9.2e+67) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-2.0d0) * (c * (c * (b * i)))
t_2 = x * (2.0d0 * y)
if (c <= (-11500000000.0d0)) then
tmp = t_1
else if (c <= (-4.465d-63)) then
tmp = (-2.0d0) * (i * (a * c))
else if (c <= 2.2d-215) then
tmp = t_2
else if (c <= 2.4d-13) then
tmp = t * (2.0d0 * z)
else if (c <= 9.2d+67) then
tmp = t_2
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 t_2 = x * (2.0 * y);
double tmp;
if (c <= -11500000000.0) {
tmp = t_1;
} else if (c <= -4.465e-63) {
tmp = -2.0 * (i * (a * c));
} else if (c <= 2.2e-215) {
tmp = t_2;
} else if (c <= 2.4e-13) {
tmp = t * (2.0 * z);
} else if (c <= 9.2e+67) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (c * (b * i))) t_2 = x * (2.0 * y) tmp = 0 if c <= -11500000000.0: tmp = t_1 elif c <= -4.465e-63: tmp = -2.0 * (i * (a * c)) elif c <= 2.2e-215: tmp = t_2 elif c <= 2.4e-13: tmp = t * (2.0 * z) elif c <= 9.2e+67: tmp = t_2 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)))) t_2 = Float64(x * Float64(2.0 * y)) tmp = 0.0 if (c <= -11500000000.0) tmp = t_1; elseif (c <= -4.465e-63) tmp = Float64(-2.0 * Float64(i * Float64(a * c))); elseif (c <= 2.2e-215) tmp = t_2; elseif (c <= 2.4e-13) tmp = Float64(t * Float64(2.0 * z)); elseif (c <= 9.2e+67) tmp = t_2; 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))); t_2 = x * (2.0 * y); tmp = 0.0; if (c <= -11500000000.0) tmp = t_1; elseif (c <= -4.465e-63) tmp = -2.0 * (i * (a * c)); elseif (c <= 2.2e-215) tmp = t_2; elseif (c <= 2.4e-13) tmp = t * (2.0 * z); elseif (c <= 9.2e+67) tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -11500000000.0], t$95$1, If[LessEqual[c, -4.465e-63], N[(-2.0 * N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.2e-215], t$95$2, If[LessEqual[c, 2.4e-13], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e+67], t$95$2, 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)\\
t_2 := x \cdot \left(2 \cdot y\right)\\
\mathbf{if}\;c \leq -11500000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -4.465 \cdot 10^{-63}:\\
\;\;\;\;-2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{-215}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 2.4 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{elif}\;c \leq 9.2 \cdot 10^{+67}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.15e10 or 9.1999999999999994e67 < c Initial program 87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
fma-define87.6%
*-commutative87.6%
associate-*l*94.5%
+-commutative94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in i around inf 83.0%
Taylor expanded in a around 0 68.1%
associate-*r*67.3%
*-commutative67.3%
associate-*l*67.2%
*-commutative67.2%
Simplified67.2%
if -1.15e10 < c < -4.465e-63Initial program 99.8%
Taylor expanded in a around inf 99.7%
Taylor expanded in a around inf 50.9%
associate-*r*51.0%
*-commutative51.0%
Simplified51.0%
if -4.465e-63 < c < 2.19999999999999996e-215 or 2.3999999999999999e-13 < c < 9.1999999999999994e67Initial program 95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
associate--l+95.9%
*-commutative95.9%
associate--l+95.9%
fma-define97.3%
*-commutative97.3%
associate-*l*92.1%
+-commutative92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in x around inf 52.9%
*-commutative52.9%
associate-*l*52.9%
Simplified52.9%
if 2.19999999999999996e-215 < c < 2.3999999999999999e-13Initial program 98.2%
associate--l+98.2%
*-commutative98.2%
associate--l+98.2%
associate--l+98.2%
*-commutative98.2%
associate--l+98.2%
fma-define98.3%
*-commutative98.3%
associate-*l*96.7%
+-commutative96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in z around inf 50.9%
associate-*r*50.9%
*-commutative50.9%
associate-*l*50.9%
*-commutative50.9%
Simplified50.9%
Final simplification58.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1e+41) (not (<= (* x y) 5e+153))) (* y (* 2.0 (+ x (* t (/ z y))))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1e+41) || !((x * y) <= 5e+153)) {
tmp = y * (2.0 * (x + (t * (z / y))));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
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+41)) .or. (.not. ((x * y) <= 5d+153))) then
tmp = y * (2.0d0 * (x + (t * (z / y))))
else
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
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+41) || !((x * y) <= 5e+153)) {
tmp = y * (2.0 * (x + (t * (z / y))));
} else {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1e+41) or not ((x * y) <= 5e+153): tmp = y * (2.0 * (x + (t * (z / y)))) else: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1e+41) || !(Float64(x * y) <= 5e+153)) tmp = Float64(y * Float64(2.0 * Float64(x + Float64(t * Float64(z / y))))); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1e+41) || ~(((x * y) <= 5e+153))) tmp = y * (2.0 * (x + (t * (z / y)))); else tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+41], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+153]], $MachinePrecision]], N[(y * N[(2.0 * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+41} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+153}\right):\\
\;\;\;\;y \cdot \left(2 \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000001e41 or 5.00000000000000018e153 < (*.f64 x y) Initial program 91.0%
associate--l+91.0%
*-commutative91.0%
associate--l+91.0%
associate--l+91.0%
*-commutative91.0%
associate--l+91.0%
fma-define92.1%
*-commutative92.1%
associate-*l*93.3%
+-commutative93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in c around 0 84.2%
Taylor expanded in y around inf 86.3%
distribute-lft-out86.3%
associate-/l*86.4%
Simplified86.4%
if -1.00000000000000001e41 < (*.f64 x y) < 5.00000000000000018e153Initial program 94.3%
associate--l+94.3%
*-commutative94.3%
associate--l+94.3%
associate--l+94.3%
*-commutative94.3%
associate--l+94.3%
fma-define94.3%
*-commutative94.3%
associate-*l*94.2%
+-commutative94.2%
fma-define94.2%
Simplified94.2%
Taylor expanded in x around 0 85.5%
Final simplification85.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.6e-20) (not (<= c 6.2e+67))) (* -2.0 (* 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 <= -1.6e-20) || !(c <= 6.2e+67)) {
tmp = -2.0 * (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 <= (-1.6d-20)) .or. (.not. (c <= 6.2d+67))) then
tmp = (-2.0d0) * (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 <= -1.6e-20) || !(c <= 6.2e+67)) {
tmp = -2.0 * (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 <= -1.6e-20) or not (c <= 6.2e+67): tmp = -2.0 * (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 <= -1.6e-20) || !(c <= 6.2e+67)) tmp = Float64(-2.0 * 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 <= -1.6e-20) || ~((c <= 6.2e+67))) tmp = -2.0 * (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, -1.6e-20], N[Not[LessEqual[c, 6.2e+67]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $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 -1.6 \cdot 10^{-20} \lor \neg \left(c \leq 6.2 \cdot 10^{+67}\right):\\
\;\;\;\;-2 \cdot \left(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 < -1.59999999999999985e-20 or 6.19999999999999992e67 < c Initial program 88.0%
associate--l+88.0%
*-commutative88.0%
associate--l+88.0%
associate--l+88.0%
*-commutative88.0%
associate--l+88.0%
fma-define88.0%
*-commutative88.0%
associate-*l*94.7%
+-commutative94.7%
fma-define94.7%
Simplified94.7%
Taylor expanded in i around inf 82.7%
if -1.59999999999999985e-20 < c < 6.19999999999999992e67Initial program 97.1%
associate--l+97.1%
*-commutative97.1%
associate--l+97.1%
associate--l+97.1%
*-commutative97.1%
associate--l+97.1%
fma-define97.9%
*-commutative97.9%
associate-*l*93.3%
+-commutative93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in c around 0 79.6%
Final simplification80.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* t (* 2.0 z))))
(if (<= z -1.1e+133)
t_1
(if (<= z -4.9e+82)
(* -2.0 (* a (* c i)))
(if (<= z 4.8e-47) (* x (* 2.0 y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = t * (2.0 * z);
double tmp;
if (z <= -1.1e+133) {
tmp = t_1;
} else if (z <= -4.9e+82) {
tmp = -2.0 * (a * (c * i));
} else if (z <= 4.8e-47) {
tmp = x * (2.0 * y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = t * (2.0d0 * z)
if (z <= (-1.1d+133)) then
tmp = t_1
else if (z <= (-4.9d+82)) then
tmp = (-2.0d0) * (a * (c * i))
else if (z <= 4.8d-47) then
tmp = x * (2.0d0 * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = t * (2.0 * z);
double tmp;
if (z <= -1.1e+133) {
tmp = t_1;
} else if (z <= -4.9e+82) {
tmp = -2.0 * (a * (c * i));
} else if (z <= 4.8e-47) {
tmp = x * (2.0 * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = t * (2.0 * z) tmp = 0 if z <= -1.1e+133: tmp = t_1 elif z <= -4.9e+82: tmp = -2.0 * (a * (c * i)) elif z <= 4.8e-47: tmp = x * (2.0 * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(t * Float64(2.0 * z)) tmp = 0.0 if (z <= -1.1e+133) tmp = t_1; elseif (z <= -4.9e+82) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (z <= 4.8e-47) tmp = Float64(x * Float64(2.0 * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = t * (2.0 * z); tmp = 0.0; if (z <= -1.1e+133) tmp = t_1; elseif (z <= -4.9e+82) tmp = -2.0 * (a * (c * i)); elseif (z <= 4.8e-47) tmp = x * (2.0 * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+133], t$95$1, If[LessEqual[z, -4.9e+82], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-47], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(2 \cdot z\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{+82}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e133 or 4.7999999999999999e-47 < z Initial program 93.7%
associate--l+93.7%
*-commutative93.7%
associate--l+93.7%
associate--l+93.7%
*-commutative93.7%
associate--l+93.7%
fma-define94.5%
*-commutative94.5%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in z around inf 46.6%
associate-*r*46.6%
*-commutative46.6%
associate-*l*46.6%
*-commutative46.6%
Simplified46.6%
if -1.1e133 < z < -4.9000000000000001e82Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 64.0%
if -4.9000000000000001e82 < z < 4.7999999999999999e-47Initial program 91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
associate--l+91.7%
*-commutative91.7%
associate--l+91.7%
fma-define91.7%
*-commutative91.7%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in x around inf 39.0%
*-commutative39.0%
associate-*l*39.0%
Simplified39.0%
Final simplification44.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -1.8e+24)
(* -2.0 (* c (* c (* b i))))
(if (<= c 1.2e+68)
(* 2.0 (+ (* x y) (* z t)))
(* -2.0 (* c (* (* b c) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -1.8e+24) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.2e+68) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
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.8d+24)) then
tmp = (-2.0d0) * (c * (c * (b * i)))
else if (c <= 1.2d+68) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (-2.0d0) * (c * ((b * c) * i))
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.8e+24) {
tmp = -2.0 * (c * (c * (b * i)));
} else if (c <= 1.2e+68) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -1.8e+24: tmp = -2.0 * (c * (c * (b * i))) elif c <= 1.2e+68: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = -2.0 * (c * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -1.8e+24) tmp = Float64(-2.0 * Float64(c * Float64(c * Float64(b * i)))); elseif (c <= 1.2e+68) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -1.8e+24) tmp = -2.0 * (c * (c * (b * i))); elseif (c <= 1.2e+68) tmp = 2.0 * ((x * y) + (z * t)); else tmp = -2.0 * (c * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.8e+24], N[(-2.0 * N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.2e+68], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.8 \cdot 10^{+24}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{+68}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.79999999999999992e24Initial program 90.7%
associate--l+90.7%
*-commutative90.7%
associate--l+90.7%
associate--l+90.7%
*-commutative90.7%
associate--l+90.7%
fma-define90.7%
*-commutative90.7%
associate-*l*94.3%
+-commutative94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in i around inf 86.7%
Taylor expanded in a around 0 72.7%
associate-*r*71.0%
*-commutative71.0%
associate-*l*72.8%
*-commutative72.8%
Simplified72.8%
if -1.79999999999999992e24 < c < 1.20000000000000004e68Initial program 97.3%
associate--l+97.3%
*-commutative97.3%
associate--l+97.3%
associate--l+97.3%
*-commutative97.3%
associate--l+97.3%
fma-define98.0%
*-commutative98.0%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in c around 0 77.9%
if 1.20000000000000004e68 < c Initial program 83.9%
associate--l+83.9%
*-commutative83.9%
associate--l+83.9%
associate--l+83.9%
*-commutative83.9%
associate--l+83.9%
fma-define83.9%
*-commutative83.9%
associate-*l*94.3%
+-commutative94.3%
fma-define94.3%
Simplified94.3%
Taylor expanded in i around inf 81.9%
Taylor expanded in a around 0 65.6%
*-commutative65.6%
Simplified65.6%
Final simplification74.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -3.3e+111) (not (<= z 8e-48))) (* t (* 2.0 z)) (* x (* 2.0 y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -3.3e+111) || !(z <= 8e-48)) {
tmp = t * (2.0 * z);
} else {
tmp = x * (2.0 * 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 ((z <= (-3.3d+111)) .or. (.not. (z <= 8d-48))) then
tmp = t * (2.0d0 * z)
else
tmp = x * (2.0d0 * 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 ((z <= -3.3e+111) || !(z <= 8e-48)) {
tmp = t * (2.0 * z);
} else {
tmp = x * (2.0 * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -3.3e+111) or not (z <= 8e-48): tmp = t * (2.0 * z) else: tmp = x * (2.0 * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -3.3e+111) || !(z <= 8e-48)) tmp = Float64(t * Float64(2.0 * z)); else tmp = Float64(x * Float64(2.0 * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -3.3e+111) || ~((z <= 8e-48))) tmp = t * (2.0 * z); else tmp = x * (2.0 * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -3.3e+111], N[Not[LessEqual[z, 8e-48]], $MachinePrecision]], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+111} \lor \neg \left(z \leq 8 \cdot 10^{-48}\right):\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\end{array}
\end{array}
if z < -3.3000000000000001e111 or 7.9999999999999998e-48 < z Initial program 94.0%
associate--l+94.0%
*-commutative94.0%
associate--l+94.0%
associate--l+94.0%
*-commutative94.0%
associate--l+94.0%
fma-define94.7%
*-commutative94.7%
associate-*l*93.9%
+-commutative93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in z around inf 46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*l*46.1%
*-commutative46.1%
Simplified46.1%
if -3.3000000000000001e111 < z < 7.9999999999999998e-48Initial program 92.3%
associate--l+92.3%
*-commutative92.3%
associate--l+92.3%
associate--l+92.3%
*-commutative92.3%
associate--l+92.3%
fma-define92.3%
*-commutative92.3%
associate-*l*93.9%
+-commutative93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in x around inf 37.2%
*-commutative37.2%
associate-*l*37.2%
Simplified37.2%
Final simplification41.7%
(FPCore (x y z t a b c i) :precision binary64 (* t (* 2.0 z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
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 = t * (2.0d0 * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
def code(x, y, z, t, a, b, c, i): return t * (2.0 * z)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(2.0 * z)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (2.0 * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(2 \cdot z\right)
\end{array}
Initial program 93.2%
associate--l+93.2%
*-commutative93.2%
associate--l+93.2%
associate--l+93.2%
*-commutative93.2%
associate--l+93.2%
fma-define93.5%
*-commutative93.5%
associate-*l*93.9%
+-commutative93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in z around inf 29.1%
associate-*r*29.1%
*-commutative29.1%
associate-*l*29.1%
*-commutative29.1%
Simplified29.1%
Final simplification29.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 2024132
(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))))