
(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 14 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))))
(* 2.0 (fma y x (- (* z t) (* 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 = 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 = 2.0 * fma(y, x, ((z * t) - (c * (b * (c * i)))));
}
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(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i)))))); 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[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\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.7%
fma-def96.7%
associate-*l*99.9%
Simplified99.9%
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%
fma-def22.2%
*-commutative22.2%
+-commutative22.2%
fma-udef22.2%
associate-*r*22.2%
Applied egg-rr22.2%
Taylor expanded in b around inf 66.7%
Final simplification98.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i))))
(if (<= t_1 INFINITY)
(* t_1 2.0)
(* 2.0 (fma y x (- (* z t) (* 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 * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = 2.0 * fma(y, x, ((z * t) - (c * (b * (c * i)))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i)))))); end return 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[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\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.7%
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%
fma-def22.2%
*-commutative22.2%
+-commutative22.2%
fma-udef22.2%
associate-*r*22.2%
Applied egg-rr22.2%
Taylor expanded in b around inf 66.7%
Final simplification95.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* (* c i) (* a -2.0)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -2e-46)
t_3
(if (<= (* x y) 5e-187)
t_1
(if (<= (* x y) 5e-109)
t_2
(if (<= (* x y) 5e+60)
t_1
(if (<= (* x y) 1e+89) t_2 (if (<= (* x y) 1e+100) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (c * i) * (a * -2.0);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e-46) {
tmp = t_3;
} else if ((x * y) <= 5e-187) {
tmp = t_1;
} else if ((x * y) <= 5e-109) {
tmp = t_2;
} else if ((x * y) <= 5e+60) {
tmp = t_1;
} else if ((x * y) <= 1e+89) {
tmp = t_2;
} else if ((x * y) <= 1e+100) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = 2.0d0 * (z * t)
t_2 = (c * i) * (a * (-2.0d0))
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-2d-46)) then
tmp = t_3
else if ((x * y) <= 5d-187) then
tmp = t_1
else if ((x * y) <= 5d-109) then
tmp = t_2
else if ((x * y) <= 5d+60) then
tmp = t_1
else if ((x * y) <= 1d+89) then
tmp = t_2
else if ((x * y) <= 1d+100) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (c * i) * (a * -2.0);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2e-46) {
tmp = t_3;
} else if ((x * y) <= 5e-187) {
tmp = t_1;
} else if ((x * y) <= 5e-109) {
tmp = t_2;
} else if ((x * y) <= 5e+60) {
tmp = t_1;
} else if ((x * y) <= 1e+89) {
tmp = t_2;
} else if ((x * y) <= 1e+100) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (c * i) * (a * -2.0) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2e-46: tmp = t_3 elif (x * y) <= 5e-187: tmp = t_1 elif (x * y) <= 5e-109: tmp = t_2 elif (x * y) <= 5e+60: tmp = t_1 elif (x * y) <= 1e+89: tmp = t_2 elif (x * y) <= 1e+100: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(c * i) * Float64(a * -2.0)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2e-46) tmp = t_3; elseif (Float64(x * y) <= 5e-187) tmp = t_1; elseif (Float64(x * y) <= 5e-109) tmp = t_2; elseif (Float64(x * y) <= 5e+60) tmp = t_1; elseif (Float64(x * y) <= 1e+89) tmp = t_2; elseif (Float64(x * y) <= 1e+100) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); t_2 = (c * i) * (a * -2.0); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2e-46) tmp = t_3; elseif ((x * y) <= 5e-187) tmp = t_1; elseif ((x * y) <= 5e-109) tmp = t_2; elseif ((x * y) <= 5e+60) tmp = t_1; elseif ((x * y) <= 1e+89) tmp = t_2; elseif ((x * y) <= 1e+100) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e-46], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 5e-187], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-109], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e+60], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+89], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e+100], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-46}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-109}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+89}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000005e-46 or 1.00000000000000002e100 < (*.f64 x y) Initial program 93.8%
Taylor expanded in x around inf 55.8%
if -2.00000000000000005e-46 < (*.f64 x y) < 4.9999999999999996e-187 or 5.0000000000000002e-109 < (*.f64 x y) < 4.99999999999999975e60 or 9.99999999999999995e88 < (*.f64 x y) < 1.00000000000000002e100Initial program 92.9%
Taylor expanded in z around inf 46.1%
if 4.9999999999999996e-187 < (*.f64 x y) < 5.0000000000000002e-109 or 4.99999999999999975e60 < (*.f64 x y) < 9.99999999999999995e88Initial program 92.3%
Taylor expanded in a around inf 60.3%
mul-1-neg60.3%
*-commutative60.3%
distribute-rgt-neg-in60.3%
Simplified60.3%
Taylor expanded in c around 0 60.3%
associate-*r*60.3%
*-commutative60.3%
*-commutative60.3%
Simplified60.3%
Final simplification52.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c t_1)))
(if (<= t_2 -5e+291)
(* 2.0 (* (* t_1 i) (- c)))
(* (- (+ (* x y) (* z t)) (* t_2 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 = c * t_1;
double tmp;
if (t_2 <= -5e+291) {
tmp = 2.0 * ((t_1 * i) * -c);
} else {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * t_1
if (t_2 <= (-5d+291)) then
tmp = 2.0d0 * ((t_1 * i) * -c)
else
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * t_1;
double tmp;
if (t_2 <= -5e+291) {
tmp = 2.0 * ((t_1 * i) * -c);
} else {
tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * t_1 tmp = 0 if t_2 <= -5e+291: tmp = 2.0 * ((t_1 * i) * -c) else: tmp = (((x * y) + (z * t)) - (t_2 * 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(c * t_1) tmp = 0.0 if (t_2 <= -5e+291) tmp = Float64(2.0 * Float64(Float64(t_1 * i) * Float64(-c))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_2 * 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 = c * t_1; tmp = 0.0; if (t_2 <= -5e+291) tmp = 2.0 * ((t_1 * i) * -c); else tmp = (((x * y) + (z * t)) - (t_2 * 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[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+291], N[(2.0 * N[(N[(t$95$1 * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot t_1\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+291}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2 \cdot i\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -5.0000000000000001e291Initial program 76.5%
Taylor expanded in i around inf 92.0%
if -5.0000000000000001e291 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 96.2%
Final simplification95.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i)))
(t_2 (+ (* x y) (* z t)))
(t_3 (* 2.0 (- t_2 (* i (* a c)))))
(t_4 (* 2.0 (- (* z t) t_1))))
(if (<= c -3.1e+63)
(* 2.0 (- (* x y) t_1))
(if (<= c -4.8e-7)
t_4
(if (<= c -3e-24)
t_3
(if (<= c -1.15e-125)
(* 2.0 (- t_2 (* i (* c (* b c)))))
(if (<= c 2.8e+70) t_3 t_4)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = (x * y) + (z * t);
double t_3 = 2.0 * (t_2 - (i * (a * c)));
double t_4 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -3.1e+63) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -4.8e-7) {
tmp = t_4;
} else if (c <= -3e-24) {
tmp = t_3;
} else if (c <= -1.15e-125) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else if (c <= 2.8e+70) {
tmp = t_3;
} else {
tmp = t_4;
}
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) :: t_4
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = (x * y) + (z * t)
t_3 = 2.0d0 * (t_2 - (i * (a * c)))
t_4 = 2.0d0 * ((z * t) - t_1)
if (c <= (-3.1d+63)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= (-4.8d-7)) then
tmp = t_4
else if (c <= (-3d-24)) then
tmp = t_3
else if (c <= (-1.15d-125)) then
tmp = 2.0d0 * (t_2 - (i * (c * (b * c))))
else if (c <= 2.8d+70) then
tmp = t_3
else
tmp = t_4
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 = c * ((a + (b * c)) * i);
double t_2 = (x * y) + (z * t);
double t_3 = 2.0 * (t_2 - (i * (a * c)));
double t_4 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -3.1e+63) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -4.8e-7) {
tmp = t_4;
} else if (c <= -3e-24) {
tmp = t_3;
} else if (c <= -1.15e-125) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else if (c <= 2.8e+70) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = (x * y) + (z * t) t_3 = 2.0 * (t_2 - (i * (a * c))) t_4 = 2.0 * ((z * t) - t_1) tmp = 0 if c <= -3.1e+63: tmp = 2.0 * ((x * y) - t_1) elif c <= -4.8e-7: tmp = t_4 elif c <= -3e-24: tmp = t_3 elif c <= -1.15e-125: tmp = 2.0 * (t_2 - (i * (c * (b * c)))) elif c <= 2.8e+70: tmp = t_3 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(Float64(x * y) + Float64(z * t)) t_3 = Float64(2.0 * Float64(t_2 - Float64(i * Float64(a * c)))) t_4 = Float64(2.0 * Float64(Float64(z * t) - t_1)) tmp = 0.0 if (c <= -3.1e+63) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= -4.8e-7) tmp = t_4; elseif (c <= -3e-24) tmp = t_3; elseif (c <= -1.15e-125) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(c * Float64(b * c))))); elseif (c <= 2.8e+70) tmp = t_3; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = (x * y) + (z * t); t_3 = 2.0 * (t_2 - (i * (a * c))); t_4 = 2.0 * ((z * t) - t_1); tmp = 0.0; if (c <= -3.1e+63) tmp = 2.0 * ((x * y) - t_1); elseif (c <= -4.8e-7) tmp = t_4; elseif (c <= -3e-24) tmp = t_3; elseif (c <= -1.15e-125) tmp = 2.0 * (t_2 - (i * (c * (b * c)))); elseif (c <= 2.8e+70) tmp = t_3; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.1e+63], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4.8e-7], t$95$4, If[LessEqual[c, -3e-24], t$95$3, If[LessEqual[c, -1.15e-125], N[(2.0 * N[(t$95$2 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.8e+70], t$95$3, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := x \cdot y + z \cdot t\\
t_3 := 2 \cdot \left(t_2 - i \cdot \left(a \cdot c\right)\right)\\
t_4 := 2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{if}\;c \leq -3.1 \cdot 10^{+63}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\mathbf{elif}\;c \leq -4.8 \cdot 10^{-7}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;c \leq -3 \cdot 10^{-24}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -1.15 \cdot 10^{-125}:\\
\;\;\;\;2 \cdot \left(t_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.8 \cdot 10^{+70}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if c < -3.1000000000000001e63Initial program 85.7%
Taylor expanded in z around 0 89.7%
if -3.1000000000000001e63 < c < -4.79999999999999957e-7 or 2.7999999999999999e70 < c Initial program 88.0%
Taylor expanded in x around 0 91.7%
if -4.79999999999999957e-7 < c < -2.99999999999999995e-24 or -1.15e-125 < c < 2.7999999999999999e70Initial program 98.8%
Taylor expanded in a around inf 98.8%
*-commutative98.8%
Simplified98.8%
if -2.99999999999999995e-24 < c < -1.15e-125Initial program 96.0%
Taylor expanded in a around 0 96.1%
Final simplification95.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i)))
(t_2 (* 2.0 (- (* x y) t_1)))
(t_3 (* 2.0 (- (* z t) t_1))))
(if (<= c -5.2e+64)
t_2
(if (<= c -3e-14)
t_3
(if (<= c -3.6e-136)
t_2
(if (<= c 5.1e+106) (* (+ (* x y) (* z t)) 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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double t_3 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -5.2e+64) {
tmp = t_2;
} else if (c <= -3e-14) {
tmp = t_3;
} else if (c <= -3.6e-136) {
tmp = t_2;
} else if (c <= 5.1e+106) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_3;
}
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 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((x * y) - t_1)
t_3 = 2.0d0 * ((z * t) - t_1)
if (c <= (-5.2d+64)) then
tmp = t_2
else if (c <= (-3d-14)) then
tmp = t_3
else if (c <= (-3.6d-136)) then
tmp = t_2
else if (c <= 5.1d+106) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = t_3
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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double t_3 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -5.2e+64) {
tmp = t_2;
} else if (c <= -3e-14) {
tmp = t_3;
} else if (c <= -3.6e-136) {
tmp = t_2;
} else if (c <= 5.1e+106) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((x * y) - t_1) t_3 = 2.0 * ((z * t) - t_1) tmp = 0 if c <= -5.2e+64: tmp = t_2 elif c <= -3e-14: tmp = t_3 elif c <= -3.6e-136: tmp = t_2 elif c <= 5.1e+106: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(2.0 * Float64(Float64(x * y) - t_1)) t_3 = Float64(2.0 * Float64(Float64(z * t) - t_1)) tmp = 0.0 if (c <= -5.2e+64) tmp = t_2; elseif (c <= -3e-14) tmp = t_3; elseif (c <= -3.6e-136) tmp = t_2; elseif (c <= 5.1e+106) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = 2.0 * ((x * y) - t_1); t_3 = 2.0 * ((z * t) - t_1); tmp = 0.0; if (c <= -5.2e+64) tmp = t_2; elseif (c <= -3e-14) tmp = t_3; elseif (c <= -3.6e-136) tmp = t_2; elseif (c <= 5.1e+106) tmp = ((x * y) + (z * t)) * 2.0; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.2e+64], t$95$2, If[LessEqual[c, -3e-14], t$95$3, If[LessEqual[c, -3.6e-136], t$95$2, If[LessEqual[c, 5.1e+106], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(x \cdot y - t_1\right)\\
t_3 := 2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{if}\;c \leq -5.2 \cdot 10^{+64}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -3 \cdot 10^{-14}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -3.6 \cdot 10^{-136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 5.1 \cdot 10^{+106}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -5.19999999999999994e64 or -2.9999999999999998e-14 < c < -3.5999999999999998e-136Initial program 90.1%
Taylor expanded in z around 0 83.0%
if -5.19999999999999994e64 < c < -2.9999999999999998e-14 or 5.09999999999999971e106 < c Initial program 89.4%
Taylor expanded in x around 0 93.2%
if -3.5999999999999998e-136 < c < 5.09999999999999971e106Initial program 97.8%
Taylor expanded in c around 0 86.9%
Final simplification86.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i)))
(t_2 (* 2.0 (- (* x y) t_1)))
(t_3 (* 2.0 (- (* z t) t_1))))
(if (<= c -1.05e+65)
t_2
(if (<= c -2.2e-14)
t_3
(if (<= c -6.5e-61)
t_2
(if (<= c 3.2e+76)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
t_3))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double t_3 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -1.05e+65) {
tmp = t_2;
} else if (c <= -2.2e-14) {
tmp = t_3;
} else if (c <= -6.5e-61) {
tmp = t_2;
} else if (c <= 3.2e+76) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = t_3;
}
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 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((x * y) - t_1)
t_3 = 2.0d0 * ((z * t) - t_1)
if (c <= (-1.05d+65)) then
tmp = t_2
else if (c <= (-2.2d-14)) then
tmp = t_3
else if (c <= (-6.5d-61)) then
tmp = t_2
else if (c <= 3.2d+76) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = t_3
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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double t_3 = 2.0 * ((z * t) - t_1);
double tmp;
if (c <= -1.05e+65) {
tmp = t_2;
} else if (c <= -2.2e-14) {
tmp = t_3;
} else if (c <= -6.5e-61) {
tmp = t_2;
} else if (c <= 3.2e+76) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((x * y) - t_1) t_3 = 2.0 * ((z * t) - t_1) tmp = 0 if c <= -1.05e+65: tmp = t_2 elif c <= -2.2e-14: tmp = t_3 elif c <= -6.5e-61: tmp = t_2 elif c <= 3.2e+76: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(2.0 * Float64(Float64(x * y) - t_1)) t_3 = Float64(2.0 * Float64(Float64(z * t) - t_1)) tmp = 0.0 if (c <= -1.05e+65) tmp = t_2; elseif (c <= -2.2e-14) tmp = t_3; elseif (c <= -6.5e-61) tmp = t_2; elseif (c <= 3.2e+76) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); t_2 = 2.0 * ((x * y) - t_1); t_3 = 2.0 * ((z * t) - t_1); tmp = 0.0; if (c <= -1.05e+65) tmp = t_2; elseif (c <= -2.2e-14) tmp = t_3; elseif (c <= -6.5e-61) tmp = t_2; elseif (c <= 3.2e+76) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.05e+65], t$95$2, If[LessEqual[c, -2.2e-14], t$95$3, If[LessEqual[c, -6.5e-61], t$95$2, If[LessEqual[c, 3.2e+76], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(x \cdot y - t_1\right)\\
t_3 := 2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{if}\;c \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq -2.2 \cdot 10^{-14}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \leq -6.5 \cdot 10^{-61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{+76}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if c < -1.04999999999999996e65 or -2.2000000000000001e-14 < c < -6.4999999999999994e-61Initial program 86.7%
Taylor expanded in z around 0 88.6%
if -1.04999999999999996e65 < c < -2.2000000000000001e-14 or 3.19999999999999976e76 < c Initial program 88.2%
Taylor expanded in x around 0 91.8%
if -6.4999999999999994e-61 < c < 3.19999999999999976e76Initial program 98.9%
Taylor expanded in a around inf 95.2%
*-commutative95.2%
Simplified95.2%
Final simplification92.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e-44) (not (<= (* x y) 2e-65))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* z t) (* c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2e-44) || !((x * y) <= 2e-65)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * 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) <= (-2d-44)) .or. (.not. ((x * y) <= 2d-65))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (c * (a * 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) <= -2e-44) || !((x * y) <= 2e-65)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2e-44) or not ((x * y) <= 2e-65): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (c * (a * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2e-44) || !(Float64(x * y) <= 2e-65)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2e-44) || ~(((x * y) <= 2e-65))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (c * (a * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e-44], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e-65]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-44} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-65}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999991e-44 or 1.99999999999999985e-65 < (*.f64 x y) Initial program 94.1%
Taylor expanded in c around 0 65.4%
if -1.99999999999999991e-44 < (*.f64 x y) < 1.99999999999999985e-65Initial program 92.0%
Taylor expanded in x around 0 85.0%
Taylor expanded in a around inf 65.7%
Final simplification65.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -0.1) (not (<= (* x y) 2e-65))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* z t) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -0.1) || !((x * y) <= 2e-65)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-0.1d0)) .or. (.not. ((x * y) <= 2d-65))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -0.1) || !((x * y) <= 2e-65)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -0.1) or not ((x * y) <= 2e-65): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -0.1) || !(Float64(x * y) <= 2e-65)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -0.1) || ~(((x * y) <= 2e-65))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -0.1], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e-65]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -0.1 \lor \neg \left(x \cdot y \leq 2 \cdot 10^{-65}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -0.10000000000000001 or 1.99999999999999985e-65 < (*.f64 x y) Initial program 93.9%
Taylor expanded in c around 0 66.8%
if -0.10000000000000001 < (*.f64 x y) < 1.99999999999999985e-65Initial program 92.4%
Taylor expanded in x around 0 83.8%
distribute-lft-in81.8%
flip-+37.5%
*-commutative37.5%
*-commutative37.5%
*-commutative37.5%
Applied egg-rr37.5%
Taylor expanded in c around 0 68.5%
associate-*r*67.1%
*-commutative67.1%
*-commutative67.1%
Simplified67.1%
Final simplification66.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1e-33) (not (<= c 1.18e+86))) (* 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 <= -1e-33) || !(c <= 1.18e+86)) {
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 <= (-1d-33)) .or. (.not. (c <= 1.18d+86))) 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 <= -1e-33) || !(c <= 1.18e+86)) {
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 <= -1e-33) or not (c <= 1.18e+86): 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 <= -1e-33) || !(c <= 1.18e+86)) 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 <= -1e-33) || ~((c <= 1.18e+86))) 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, -1e-33], N[Not[LessEqual[c, 1.18e+86]], $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 -1 \cdot 10^{-33} \lor \neg \left(c \leq 1.18 \cdot 10^{+86}\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 < -1.0000000000000001e-33 or 1.18e86 < c Initial program 88.3%
Taylor expanded in x around 0 84.1%
if -1.0000000000000001e-33 < c < 1.18e86Initial program 97.5%
Taylor expanded in c around 0 82.0%
Final simplification83.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -8.5e-9) (not (<= c 1.75e+86))) (* 2.0 (* (* (+ a (* b c)) i) (- c))) (* (+ (* 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.5e-9) || !(c <= 1.75e+86)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} 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.5d-9)) .or. (.not. (c <= 1.75d+86))) then
tmp = 2.0d0 * (((a + (b * c)) * i) * -c)
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.5e-9) || !(c <= 1.75e+86)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} 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.5e-9) or not (c <= 1.75e+86): tmp = 2.0 * (((a + (b * c)) * i) * -c) 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.5e-9) || !(c <= 1.75e+86)) tmp = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))); 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.5e-9) || ~((c <= 1.75e+86))) tmp = 2.0 * (((a + (b * c)) * i) * -c); 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.5e-9], N[Not[LessEqual[c, 1.75e+86]], $MachinePrecision]], N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $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.5 \cdot 10^{-9} \lor \neg \left(c \leq 1.75 \cdot 10^{+86}\right):\\
\;\;\;\;2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -8.5e-9 or 1.75000000000000009e86 < c Initial program 87.4%
Taylor expanded in i around inf 76.7%
if -8.5e-9 < c < 1.75000000000000009e86Initial program 97.6%
Taylor expanded in c around 0 80.3%
Final simplification78.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e-46) (not (<= (* x y) 4e+76))) (* (* 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 (((x * y) <= -2e-46) || !((x * y) <= 4e+76)) {
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 (((x * y) <= (-2d-46)) .or. (.not. ((x * y) <= 4d+76))) 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 (((x * y) <= -2e-46) || !((x * y) <= 4e+76)) {
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 ((x * y) <= -2e-46) or not ((x * y) <= 4e+76): 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 ((Float64(x * y) <= -2e-46) || !(Float64(x * y) <= 4e+76)) tmp = Float64(Float64(x * 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 (((x * y) <= -2e-46) || ~(((x * y) <= 4e+76))) 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[N[(x * y), $MachinePrecision], -2e-46], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4e+76]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-46} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+76}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000005e-46 or 4.0000000000000002e76 < (*.f64 x y) Initial program 94.2%
Taylor expanded in x around inf 53.7%
if -2.00000000000000005e-46 < (*.f64 x y) < 4.0000000000000002e76Initial program 92.3%
Taylor expanded in z around inf 41.4%
Final simplification48.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= i -1.8e+168) (* (* c i) (* a -2.0)) (* (+ (* 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 (i <= -1.8e+168) {
tmp = (c * i) * (a * -2.0);
} 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 (i <= (-1.8d+168)) then
tmp = (c * i) * (a * (-2.0d0))
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 (i <= -1.8e+168) {
tmp = (c * i) * (a * -2.0);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -1.8e+168: tmp = (c * i) * (a * -2.0) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -1.8e+168) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); 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 (i <= -1.8e+168) tmp = (c * i) * (a * -2.0); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -1.8e+168], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.8 \cdot 10^{+168}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -1.8e168Initial program 96.8%
Taylor expanded in a around inf 53.0%
mul-1-neg53.0%
*-commutative53.0%
distribute-rgt-neg-in53.0%
Simplified53.0%
Taylor expanded in c around 0 53.0%
associate-*r*53.0%
*-commutative53.0%
*-commutative53.0%
Simplified53.0%
if -1.8e168 < i Initial program 92.8%
Taylor expanded in c around 0 63.7%
Final simplification62.3%
(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 93.3%
Taylor expanded in z around inf 27.8%
Final simplification27.8%
(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 2023314
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))