
(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 12 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)) (* (* c t_1) i)))) (if (<= t_2 INFINITY) (* t_2 2.0) (* -2.0 (* 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 = ((x * y) + (z * t)) - ((c * t_1) * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
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)) - ((c * t_1) * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2 * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = ((x * y) + (z * t)) - ((c * t_1) * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 * 2.0 else: tmp = -2.0 * (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(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) tmp = 0.0 if (t_2 <= Inf) tmp = Float64(t_2 * 2.0); else tmp = Float64(-2.0 * 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 = ((x * y) + (z * t)) - ((c * t_1) * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2 * 2.0; else tmp = -2.0 * (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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], N[(t$95$2 * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\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 98.3%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 69.5%
Taylor expanded in i around 0 69.5%
Final simplification96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* i (* c (- a)))))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -7e+143)
t_3
(if (<= (* x y) -2.75e-102)
t_1
(if (<= (* x y) 1.3e-183)
t_2
(if (<= (* x y) 4e-25) t_1 (if (<= (* x y) 1.05e+216) t_2 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 * (i * (c * -a));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -7e+143) {
tmp = t_3;
} else if ((x * y) <= -2.75e-102) {
tmp = t_1;
} else if ((x * y) <= 1.3e-183) {
tmp = t_2;
} else if ((x * y) <= 4e-25) {
tmp = t_1;
} else if ((x * y) <= 1.05e+216) {
tmp = t_2;
} 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 * (i * (c * -a))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-7d+143)) then
tmp = t_3
else if ((x * y) <= (-2.75d-102)) then
tmp = t_1
else if ((x * y) <= 1.3d-183) then
tmp = t_2
else if ((x * y) <= 4d-25) then
tmp = t_1
else if ((x * y) <= 1.05d+216) then
tmp = t_2
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 * (i * (c * -a));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -7e+143) {
tmp = t_3;
} else if ((x * y) <= -2.75e-102) {
tmp = t_1;
} else if ((x * y) <= 1.3e-183) {
tmp = t_2;
} else if ((x * y) <= 4e-25) {
tmp = t_1;
} else if ((x * y) <= 1.05e+216) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (i * (c * -a)) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -7e+143: tmp = t_3 elif (x * y) <= -2.75e-102: tmp = t_1 elif (x * y) <= 1.3e-183: tmp = t_2 elif (x * y) <= 4e-25: tmp = t_1 elif (x * y) <= 1.05e+216: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(i * Float64(c * Float64(-a)))) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -7e+143) tmp = t_3; elseif (Float64(x * y) <= -2.75e-102) tmp = t_1; elseif (Float64(x * y) <= 1.3e-183) tmp = t_2; elseif (Float64(x * y) <= 4e-25) tmp = t_1; elseif (Float64(x * y) <= 1.05e+216) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (i * (c * -a)); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -7e+143) tmp = t_3; elseif ((x * y) <= -2.75e-102) tmp = t_1; elseif ((x * y) <= 1.3e-183) tmp = t_2; elseif ((x * y) <= 4e-25) tmp = t_1; elseif ((x * y) <= 1.05e+216) tmp = t_2; 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[(i * N[(c * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7e+143], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.75e-102], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.3e-183], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e-25], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.05e+216], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(i \cdot \left(c \cdot \left(-a\right)\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+143}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -2.75 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-183}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{+216}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -7.00000000000000017e143 or 1.05000000000000001e216 < (*.f64 x y) Initial program 82.7%
Taylor expanded in x around inf 73.8%
if -7.00000000000000017e143 < (*.f64 x y) < -2.7499999999999999e-102 or 1.2999999999999999e-183 < (*.f64 x y) < 4.00000000000000015e-25Initial program 97.1%
Taylor expanded in i around inf 91.5%
associate--l+91.5%
associate-/l*90.1%
associate-/l*87.3%
+-commutative87.3%
fma-undefine87.3%
Simplified87.3%
Taylor expanded in a around inf 47.1%
associate-*r*47.1%
mul-1-neg47.1%
Simplified47.1%
if -2.7499999999999999e-102 < (*.f64 x y) < 1.2999999999999999e-183 or 4.00000000000000015e-25 < (*.f64 x y) < 1.05000000000000001e216Initial program 96.7%
Taylor expanded in z around inf 42.8%
Final simplification51.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i))))
(t_2 (* 2.0 (* z t)))
(t_3 (* (* x y) 2.0)))
(if (<= (* x y) -1.22e+145)
t_3
(if (<= (* x y) -5.5e-102)
t_1
(if (<= (* x y) 2.6e-179)
t_2
(if (<= (* x y) 9.7e-26) t_1 (if (<= (* x y) 5.8e+213) t_2 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 * (a * (c * i));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.22e+145) {
tmp = t_3;
} else if ((x * y) <= -5.5e-102) {
tmp = t_1;
} else if ((x * y) <= 2.6e-179) {
tmp = t_2;
} else if ((x * y) <= 9.7e-26) {
tmp = t_1;
} else if ((x * y) <= 5.8e+213) {
tmp = t_2;
} 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) * (a * (c * i))
t_2 = 2.0d0 * (z * t)
t_3 = (x * y) * 2.0d0
if ((x * y) <= (-1.22d+145)) then
tmp = t_3
else if ((x * y) <= (-5.5d-102)) then
tmp = t_1
else if ((x * y) <= 2.6d-179) then
tmp = t_2
else if ((x * y) <= 9.7d-26) then
tmp = t_1
else if ((x * y) <= 5.8d+213) then
tmp = t_2
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 * (a * (c * i));
double t_2 = 2.0 * (z * t);
double t_3 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.22e+145) {
tmp = t_3;
} else if ((x * y) <= -5.5e-102) {
tmp = t_1;
} else if ((x * y) <= 2.6e-179) {
tmp = t_2;
} else if ((x * y) <= 9.7e-26) {
tmp = t_1;
} else if ((x * y) <= 5.8e+213) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) t_2 = 2.0 * (z * t) t_3 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1.22e+145: tmp = t_3 elif (x * y) <= -5.5e-102: tmp = t_1 elif (x * y) <= 2.6e-179: tmp = t_2 elif (x * y) <= 9.7e-26: tmp = t_1 elif (x * y) <= 5.8e+213: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) t_2 = Float64(2.0 * Float64(z * t)) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1.22e+145) tmp = t_3; elseif (Float64(x * y) <= -5.5e-102) tmp = t_1; elseif (Float64(x * y) <= 2.6e-179) tmp = t_2; elseif (Float64(x * y) <= 9.7e-26) tmp = t_1; elseif (Float64(x * y) <= 5.8e+213) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); t_2 = 2.0 * (z * t); t_3 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1.22e+145) tmp = t_3; elseif ((x * y) <= -5.5e-102) tmp = t_1; elseif ((x * y) <= 2.6e-179) tmp = t_2; elseif ((x * y) <= 9.7e-26) tmp = t_1; elseif ((x * y) <= 5.8e+213) tmp = t_2; 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.22e+145], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5.5e-102], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.6e-179], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9.7e-26], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.8e+213], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
t_2 := 2 \cdot \left(z \cdot t\right)\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1.22 \cdot 10^{+145}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.6 \cdot 10^{-179}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 9.7 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{+213}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -1.21999999999999994e145 or 5.8000000000000006e213 < (*.f64 x y) Initial program 82.7%
Taylor expanded in x around inf 73.8%
if -1.21999999999999994e145 < (*.f64 x y) < -5.4999999999999997e-102 or 2.60000000000000005e-179 < (*.f64 x y) < 9.7000000000000001e-26Initial program 97.0%
Taylor expanded in i around inf 60.2%
Taylor expanded in c around 0 46.8%
*-commutative46.8%
Simplified46.8%
if -5.4999999999999997e-102 < (*.f64 x y) < 2.60000000000000005e-179 or 9.7000000000000001e-26 < (*.f64 x y) < 5.8000000000000006e213Initial program 96.7%
Taylor expanded in z around inf 42.5%
Final simplification51.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* b (* c i))))))
(t_2 (* (* (* c (+ a (* b c))) i) (- 2.0))))
(if (<= i -1.5e+47)
t_2
(if (<= i -6.8e-63)
t_1
(if (<= i -5.2e-103)
t_2
(if (<= i 3.6e-56)
(* (+ (* x y) (* z t)) 2.0)
(if (<= i 48000000.0) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * (b * (c * i))));
double t_2 = ((c * (a + (b * c))) * i) * -2.0;
double tmp;
if (i <= -1.5e+47) {
tmp = t_2;
} else if (i <= -6.8e-63) {
tmp = t_1;
} else if (i <= -5.2e-103) {
tmp = t_2;
} else if (i <= 3.6e-56) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 48000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * (b * (c * i))))
t_2 = ((c * (a + (b * c))) * i) * -2.0d0
if (i <= (-1.5d+47)) then
tmp = t_2
else if (i <= (-6.8d-63)) then
tmp = t_1
else if (i <= (-5.2d-103)) then
tmp = t_2
else if (i <= 3.6d-56) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (i <= 48000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * ((z * t) - (c * (b * (c * i))));
double t_2 = ((c * (a + (b * c))) * i) * -2.0;
double tmp;
if (i <= -1.5e+47) {
tmp = t_2;
} else if (i <= -6.8e-63) {
tmp = t_1;
} else if (i <= -5.2e-103) {
tmp = t_2;
} else if (i <= 3.6e-56) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (i <= 48000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * (b * (c * i)))) t_2 = ((c * (a + (b * c))) * i) * -2.0 tmp = 0 if i <= -1.5e+47: tmp = t_2 elif i <= -6.8e-63: tmp = t_1 elif i <= -5.2e-103: tmp = t_2 elif i <= 3.6e-56: tmp = ((x * y) + (z * t)) * 2.0 elif i <= 48000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))) t_2 = Float64(Float64(Float64(c * Float64(a + Float64(b * c))) * i) * Float64(-2.0)) tmp = 0.0 if (i <= -1.5e+47) tmp = t_2; elseif (i <= -6.8e-63) tmp = t_1; elseif (i <= -5.2e-103) tmp = t_2; elseif (i <= 3.6e-56) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (i <= 48000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * ((z * t) - (c * (b * (c * i)))); t_2 = ((c * (a + (b * c))) * i) * -2.0; tmp = 0.0; if (i <= -1.5e+47) tmp = t_2; elseif (i <= -6.8e-63) tmp = t_1; elseif (i <= -5.2e-103) tmp = t_2; elseif (i <= 3.6e-56) tmp = ((x * y) + (z * t)) * 2.0; elseif (i <= 48000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-2.0)), $MachinePrecision]}, If[LessEqual[i, -1.5e+47], t$95$2, If[LessEqual[i, -6.8e-63], t$95$1, If[LessEqual[i, -5.2e-103], t$95$2, If[LessEqual[i, 3.6e-56], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[i, 48000000.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
t_2 := \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot \left(-2\right)\\
\mathbf{if}\;i \leq -1.5 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -6.8 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -5.2 \cdot 10^{-103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq 3.6 \cdot 10^{-56}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;i \leq 48000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -1.5000000000000001e47 or -6.79999999999999997e-63 < i < -5.19999999999999993e-103 or 4.8e7 < i Initial program 93.2%
Taylor expanded in i around inf 93.2%
associate--l+93.2%
associate-/l*94.0%
associate-/l*96.5%
+-commutative96.5%
fma-undefine96.5%
Simplified96.5%
Taylor expanded in i around inf 82.1%
if -1.5000000000000001e47 < i < -6.79999999999999997e-63 or 3.59999999999999978e-56 < i < 4.8e7Initial program 94.3%
Taylor expanded in x around 0 86.1%
Taylor expanded in a around 0 75.5%
if -5.19999999999999993e-103 < i < 3.59999999999999978e-56Initial program 93.2%
Taylor expanded in c around 0 80.8%
Final simplification80.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.25e+85)
(* 2.0 (- (* x y) (* a (* c i))))
(if (<= (* x y) 3.9e+262)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* (* x y) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.25e+85) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if ((x * y) <= 3.9e+262) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = (x * y) * 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 ((x * y) <= (-2.25d+85)) then
tmp = 2.0d0 * ((x * y) - (a * (c * i)))
else if ((x * y) <= 3.9d+262) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = (x * y) * 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 ((x * y) <= -2.25e+85) {
tmp = 2.0 * ((x * y) - (a * (c * i)));
} else if ((x * y) <= 3.9e+262) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2.25e+85: tmp = 2.0 * ((x * y) - (a * (c * i))) elif (x * y) <= 3.9e+262: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2.25e+85) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i)))); elseif (Float64(x * y) <= 3.9e+262) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2.25e+85) tmp = 2.0 * ((x * y) - (a * (c * i))); elseif ((x * y) <= 3.9e+262) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = (x * y) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.25e+85], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.9e+262], 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[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+85}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 3.9 \cdot 10^{+262}:\\
\;\;\;\;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\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.25000000000000003e85Initial program 89.5%
fma-define89.5%
associate-*l*93.6%
Simplified93.6%
fma-define93.6%
+-commutative93.6%
Applied egg-rr93.6%
Taylor expanded in z around inf 77.3%
Taylor expanded in z around 0 87.5%
Taylor expanded in b around 0 83.2%
if -2.25000000000000003e85 < (*.f64 x y) < 3.89999999999999985e262Initial program 96.7%
Taylor expanded in x around 0 80.3%
if 3.89999999999999985e262 < (*.f64 x y) Initial program 72.7%
Taylor expanded in x around inf 86.9%
Final simplification81.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.2e+18) (not (<= c 32000.0))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.2e+18) || !(c <= 32000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.2d+18)) .or. (.not. (c <= 32000.0d0))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.2e+18) || !(c <= 32000.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.2e+18) or not (c <= 32000.0): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.2e+18) || !(c <= 32000.0)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.2e+18) || ~((c <= 32000.0))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.2e+18], N[Not[LessEqual[c, 32000.0]], $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[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.2 \cdot 10^{+18} \lor \neg \left(c \leq 32000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -2.2e18 or 32000 < c Initial program 85.9%
Taylor expanded in x around 0 87.7%
if -2.2e18 < c < 32000Initial program 99.2%
Taylor expanded in a around inf 96.2%
*-commutative96.2%
Simplified96.2%
Final simplification92.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= y -100000.0)
(* (+ (* x y) (* z t)) 2.0)
(if (<= y 6.5e+50)
(* 2.0 (- (* z t) (* c (* t_1 i))))
(* 2.0 (- (* x y) (* t_1 (* 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 (y <= -100000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (y <= 6.5e+50) {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
} else {
tmp = 2.0 * ((x * y) - (t_1 * (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 = a + (b * c)
if (y <= (-100000.0d0)) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (y <= 6.5d+50) then
tmp = 2.0d0 * ((z * t) - (c * (t_1 * i)))
else
tmp = 2.0d0 * ((x * y) - (t_1 * (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 = a + (b * c);
double tmp;
if (y <= -100000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (y <= 6.5e+50) {
tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
} else {
tmp = 2.0 * ((x * y) - (t_1 * (c * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if y <= -100000.0: tmp = ((x * y) + (z * t)) * 2.0 elif y <= 6.5e+50: tmp = 2.0 * ((z * t) - (c * (t_1 * i))) else: tmp = 2.0 * ((x * y) - (t_1 * (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 (y <= -100000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (y <= 6.5e+50) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(t_1 * Float64(c * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); tmp = 0.0; if (y <= -100000.0) tmp = ((x * y) + (z * t)) * 2.0; elseif (y <= 6.5e+50) tmp = 2.0 * ((z * t) - (c * (t_1 * i))); else tmp = 2.0 * ((x * y) - (t_1 * (c * 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]}, If[LessEqual[y, -100000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[y, 6.5e+50], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;y \leq -100000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+50}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1 \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if y < -1e5Initial program 86.9%
Taylor expanded in c around 0 67.9%
if -1e5 < y < 6.5000000000000003e50Initial program 97.2%
Taylor expanded in x around 0 80.0%
if 6.5000000000000003e50 < y Initial program 89.6%
fma-define89.7%
associate-*l*93.6%
Simplified93.6%
fma-define93.6%
+-commutative93.6%
Applied egg-rr93.6%
Taylor expanded in z around inf 89.6%
Taylor expanded in z around 0 92.6%
Final simplification79.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.85e+30) (not (<= c 13500000000.0))) (* -2.0 (* c (* (+ a (* b c)) i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.85e+30) || !(c <= 13500000000.0)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.85d+30)) .or. (.not. (c <= 13500000000.0d0))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.85e+30) || !(c <= 13500000000.0)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.85e+30) or not (c <= 13500000000.0): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.85e+30) || !(c <= 13500000000.0)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -1.85e+30) || ~((c <= 13500000000.0))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.85e+30], N[Not[LessEqual[c, 13500000000.0]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.85 \cdot 10^{+30} \lor \neg \left(c \leq 13500000000\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.85000000000000008e30 or 1.35e10 < c Initial program 85.3%
Taylor expanded in i around inf 83.6%
Taylor expanded in i around 0 83.6%
if -1.85000000000000008e30 < c < 1.35e10Initial program 99.2%
Taylor expanded in c around 0 69.6%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))))
(if (<= c -4.2e+30)
(* (* (* c t_1) i) (- 2.0))
(if (<= c 15000000000.0)
(* (+ (* x y) (* z t)) 2.0)
(* -2.0 (* 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 tmp;
if (c <= -4.2e+30) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 15000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (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) :: tmp
t_1 = a + (b * c)
if (c <= (-4.2d+30)) then
tmp = ((c * t_1) * i) * -2.0d0
else if (c <= 15000000000.0d0) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (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 tmp;
if (c <= -4.2e+30) {
tmp = ((c * t_1) * i) * -2.0;
} else if (c <= 15000000000.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (t_1 * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) tmp = 0 if c <= -4.2e+30: tmp = ((c * t_1) * i) * -2.0 elif c <= 15000000000.0: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) tmp = 0.0 if (c <= -4.2e+30) tmp = Float64(Float64(Float64(c * t_1) * i) * Float64(-2.0)); elseif (c <= 15000000000.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * 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); tmp = 0.0; if (c <= -4.2e+30) tmp = ((c * t_1) * i) * -2.0; elseif (c <= 15000000000.0) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (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]}, If[LessEqual[c, -4.2e+30], N[(N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[c, 15000000000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;c \leq -4.2 \cdot 10^{+30}:\\
\;\;\;\;\left(\left(c \cdot t\_1\right) \cdot i\right) \cdot \left(-2\right)\\
\mathbf{elif}\;c \leq 15000000000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -4.2e30Initial program 91.1%
Taylor expanded in i around inf 85.9%
associate--l+85.9%
associate-/l*82.6%
associate-/l*84.3%
+-commutative84.3%
fma-undefine84.3%
Simplified84.3%
Taylor expanded in i around inf 86.1%
if -4.2e30 < c < 1.5e10Initial program 99.2%
Taylor expanded in c around 0 69.6%
if 1.5e10 < c Initial program 78.9%
Taylor expanded in i around inf 82.9%
Taylor expanded in i around 0 82.9%
Final simplification75.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1e+52) (not (<= i 5.5e+134))) (* -2.0 (* a (* 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 ((i <= -1e+52) || !(i <= 5.5e+134)) {
tmp = -2.0 * (a * (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 ((i <= (-1d+52)) .or. (.not. (i <= 5.5d+134))) then
tmp = (-2.0d0) * (a * (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 ((i <= -1e+52) || !(i <= 5.5e+134)) {
tmp = -2.0 * (a * (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 (i <= -1e+52) or not (i <= 5.5e+134): tmp = -2.0 * (a * (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 ((i <= -1e+52) || !(i <= 5.5e+134)) tmp = Float64(-2.0 * Float64(a * Float64(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 ((i <= -1e+52) || ~((i <= 5.5e+134))) tmp = -2.0 * (a * (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[i, -1e+52], N[Not[LessEqual[i, 5.5e+134]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1 \cdot 10^{+52} \lor \neg \left(i \leq 5.5 \cdot 10^{+134}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -9.9999999999999999e51 or 5.4999999999999999e134 < i Initial program 92.8%
Taylor expanded in i around inf 72.1%
Taylor expanded in c around 0 62.4%
*-commutative62.4%
Simplified62.4%
if -9.9999999999999999e51 < i < 5.4999999999999999e134Initial program 93.6%
Taylor expanded in c around 0 67.0%
Final simplification65.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -6.8e-12) (not (<= (* x y) 1.05e+213))) (* (* 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) <= -6.8e-12) || !((x * y) <= 1.05e+213)) {
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) <= (-6.8d-12)) .or. (.not. ((x * y) <= 1.05d+213))) 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) <= -6.8e-12) || !((x * y) <= 1.05e+213)) {
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) <= -6.8e-12) or not ((x * y) <= 1.05e+213): 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) <= -6.8e-12) || !(Float64(x * y) <= 1.05e+213)) 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) <= -6.8e-12) || ~(((x * y) <= 1.05e+213))) 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], -6.8e-12], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.05e+213]], $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 -6.8 \cdot 10^{-12} \lor \neg \left(x \cdot y \leq 1.05 \cdot 10^{+213}\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) < -6.8000000000000001e-12 or 1.05e213 < (*.f64 x y) Initial program 88.2%
Taylor expanded in x around inf 57.9%
if -6.8000000000000001e-12 < (*.f64 x y) < 1.05e213Initial program 96.2%
Taylor expanded in z around inf 37.5%
Final simplification44.9%
(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.4%
Final simplification27.4%
(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 2024106
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))