
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Initial program 93.9%
fma-define93.9%
associate-*l*97.5%
Simplified97.5%
fma-define97.5%
+-commutative97.5%
Applied egg-rr97.5%
Final simplification97.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* i (* c (+ a (* b c))))))
(if (or (<= t_1 -2e+149) (not (<= t_1 5e+69)))
(* 2.0 (- (* z t) t_1))
(* 2.0 (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (c * (a + (b * c)));
double tmp;
if ((t_1 <= -2e+149) || !(t_1 <= 5e+69)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = i * (c * (a + (b * c)))
if ((t_1 <= (-2d+149)) .or. (.not. (t_1 <= 5d+69))) then
tmp = 2.0d0 * ((z * t) - t_1)
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = i * (c * (a + (b * c)));
double tmp;
if ((t_1 <= -2e+149) || !(t_1 <= 5e+69)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = i * (c * (a + (b * c))) tmp = 0 if (t_1 <= -2e+149) or not (t_1 <= 5e+69): tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(i * Float64(c * Float64(a + Float64(b * c)))) tmp = 0.0 if ((t_1 <= -2e+149) || !(t_1 <= 5e+69)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = i * (c * (a + (b * c))); tmp = 0.0; if ((t_1 <= -2e+149) || ~((t_1 <= 5e+69))) tmp = 2.0 * ((z * t) - t_1); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+149], N[Not[LessEqual[t$95$1, 5e+69]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+149} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+69}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.0000000000000001e149 or 5.00000000000000036e69 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 88.1%
Taylor expanded in z around inf 82.1%
Taylor expanded in z around inf 87.0%
if -2.0000000000000001e149 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e69Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*98.4%
+-commutative98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in c around 0 91.2%
Final simplification89.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* i (* c t_1))))
(if (<= t_2 (- INFINITY))
(* -2.0 (* c (* t_1 i)))
(if (<= t_2 5e+69)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* z t) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = -2.0 * (c * (t_1 * i));
} else if (t_2 <= 5e+69) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = i * (c * t_1);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = -2.0 * (c * (t_1 * i));
} else if (t_2 <= 5e+69) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((z * t) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = i * (c * t_1) tmp = 0 if t_2 <= -math.inf: tmp = -2.0 * (c * (t_1 * i)) elif t_2 <= 5e+69: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((z * t) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(i * Float64(c * t_1)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); elseif (t_2 <= 5e+69) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = i * (c * t_1); tmp = 0.0; if (t_2 <= -Inf) tmp = -2.0 * (c * (t_1 * i)); elseif (t_2 <= 5e+69) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); else tmp = 2.0 * ((z * t) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+69], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := i \cdot \left(c \cdot t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+69}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 78.2%
associate--l+78.2%
*-commutative78.2%
associate--l+78.2%
associate--l+78.2%
*-commutative78.2%
associate--l+78.2%
fma-define78.2%
*-commutative78.2%
associate-*l*90.0%
+-commutative90.0%
fma-define90.0%
Simplified90.0%
Taylor expanded in i around inf 88.1%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e69Initial program 99.9%
Taylor expanded in a around inf 96.2%
*-commutative96.2%
Simplified96.2%
if 5.00000000000000036e69 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 92.5%
Taylor expanded in z around inf 88.0%
Taylor expanded in z around inf 89.5%
Final simplification92.9%
(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 1e+308)
(* 2.0 (- (+ (* x y) (* z t)) (* i t_2)))
(* -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 = c * t_1;
double tmp;
if (t_2 <= 1e+308) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} 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) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = c * t_1
if (t_2 <= 1d+308) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * t_2))
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 t_2 = c * t_1;
double tmp;
if (t_2 <= 1e+308) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2));
} 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 = c * t_1 tmp = 0 if t_2 <= 1e+308: tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)) 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(c * t_1) tmp = 0.0 if (t_2 <= 1e+308) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * t_2))); 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 = c * t_1; tmp = 0.0; if (t_2 <= 1e+308) tmp = 2.0 * (((x * y) + (z * t)) - (i * t_2)); 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[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 1e+308], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * t$95$2), $MachinePrecision]), $MachinePrecision]), $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 := c \cdot t\_1\\
\mathbf{if}\;t\_2 \leq 10^{+308}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < 1e308Initial program 97.3%
if 1e308 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 73.7%
associate--l+73.7%
*-commutative73.7%
associate--l+73.7%
associate--l+73.7%
*-commutative73.7%
associate--l+73.7%
fma-define73.7%
*-commutative73.7%
associate-*l*86.7%
+-commutative86.7%
fma-define86.7%
Simplified86.7%
Taylor expanded in i around inf 86.9%
Final simplification95.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -4.8e+102)
(* -2.0 (* c (* b (* c i))))
(if (<= c 7.5e-177)
(* x (* 2.0 y))
(if (<= c 3.1e+73) (* t (* 2.0 z)) (* -2.0 (* c (* (* b c) i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.8e+102) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 7.5e-177) {
tmp = x * (2.0 * y);
} else if (c <= 3.1e+73) {
tmp = t * (2.0 * z);
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-4.8d+102)) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else if (c <= 7.5d-177) then
tmp = x * (2.0d0 * y)
else if (c <= 3.1d+73) then
tmp = t * (2.0d0 * z)
else
tmp = (-2.0d0) * (c * ((b * c) * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -4.8e+102) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 7.5e-177) {
tmp = x * (2.0 * y);
} else if (c <= 3.1e+73) {
tmp = t * (2.0 * z);
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.8e+102: tmp = -2.0 * (c * (b * (c * i))) elif c <= 7.5e-177: tmp = x * (2.0 * y) elif c <= 3.1e+73: tmp = t * (2.0 * z) else: tmp = -2.0 * (c * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.8e+102) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); elseif (c <= 7.5e-177) tmp = Float64(x * Float64(2.0 * y)); elseif (c <= 3.1e+73) tmp = Float64(t * Float64(2.0 * z)); else tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.8e+102) tmp = -2.0 * (c * (b * (c * i))); elseif (c <= 7.5e-177) tmp = x * (2.0 * y); elseif (c <= 3.1e+73) tmp = t * (2.0 * z); else tmp = -2.0 * (c * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.8e+102], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.5e-177], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.1e+73], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+102}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 7.5 \cdot 10^{-177}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -4.79999999999999989e102Initial program 87.2%
associate--l+87.2%
*-commutative87.2%
associate--l+87.2%
associate--l+87.2%
*-commutative87.2%
associate--l+87.2%
fma-define87.2%
*-commutative87.2%
associate-*l*97.7%
+-commutative97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in i around inf 91.4%
Taylor expanded in a around 0 78.6%
if -4.79999999999999989e102 < c < 7.5e-177Initial program 99.0%
associate--l+99.0%
*-commutative99.0%
associate--l+99.0%
associate--l+99.0%
*-commutative99.0%
associate--l+99.0%
fma-define99.0%
*-commutative99.0%
associate-*l*89.5%
+-commutative89.5%
fma-define89.5%
Simplified89.5%
Taylor expanded in x around inf 45.9%
*-commutative45.9%
associate-*l*45.0%
Simplified45.0%
if 7.5e-177 < c < 3.1e73Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*97.9%
+-commutative97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in z around inf 50.5%
*-commutative50.5%
*-commutative50.5%
*-commutative50.5%
associate-*r*50.5%
Simplified50.5%
if 3.1e73 < c Initial program 82.3%
associate--l+82.3%
*-commutative82.3%
associate--l+82.3%
associate--l+82.3%
*-commutative82.3%
associate--l+82.3%
fma-define82.3%
*-commutative82.3%
associate-*l*90.2%
+-commutative90.2%
fma-define90.2%
Simplified90.2%
Taylor expanded in i around inf 78.4%
Taylor expanded in a around 0 62.7%
associate-*r*62.7%
*-commutative62.7%
associate-*l*62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in c around 0 62.7%
associate-*r*62.7%
*-commutative62.7%
Simplified62.7%
Final simplification55.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* b (* c i))))))
(if (<= c -5.6e+102)
t_1
(if (<= c 3.65e-180)
(* x (* 2.0 y))
(if (<= c 2.9e+74) (* t (* 2.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -5.6e+102) {
tmp = t_1;
} else if (c <= 3.65e-180) {
tmp = x * (2.0 * y);
} else if (c <= 2.9e+74) {
tmp = t * (2.0 * z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (-2.0d0) * (c * (b * (c * i)))
if (c <= (-5.6d+102)) then
tmp = t_1
else if (c <= 3.65d-180) then
tmp = x * (2.0d0 * y)
else if (c <= 2.9d+74) then
tmp = t * (2.0d0 * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -2.0 * (c * (b * (c * i)));
double tmp;
if (c <= -5.6e+102) {
tmp = t_1;
} else if (c <= 3.65e-180) {
tmp = x * (2.0 * y);
} else if (c <= 2.9e+74) {
tmp = t * (2.0 * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * (b * (c * i))) tmp = 0 if c <= -5.6e+102: tmp = t_1 elif c <= 3.65e-180: tmp = x * (2.0 * y) elif c <= 2.9e+74: tmp = t * (2.0 * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))) tmp = 0.0 if (c <= -5.6e+102) tmp = t_1; elseif (c <= 3.65e-180) tmp = Float64(x * Float64(2.0 * y)); elseif (c <= 2.9e+74) tmp = Float64(t * Float64(2.0 * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (c * (b * (c * i))); tmp = 0.0; if (c <= -5.6e+102) tmp = t_1; elseif (c <= 3.65e-180) tmp = x * (2.0 * y); elseif (c <= 2.9e+74) tmp = t * (2.0 * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.6e+102], t$95$1, If[LessEqual[c, 3.65e-180], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.9e+74], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3.65 \cdot 10^{-180}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -5.60000000000000037e102 or 2.9000000000000002e74 < c Initial program 84.6%
associate--l+84.6%
*-commutative84.6%
associate--l+84.6%
associate--l+84.6%
*-commutative84.6%
associate--l+84.6%
fma-define84.6%
*-commutative84.6%
associate-*l*93.8%
+-commutative93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in i around inf 84.6%
Taylor expanded in a around 0 70.2%
if -5.60000000000000037e102 < c < 3.6499999999999998e-180Initial program 99.0%
associate--l+99.0%
*-commutative99.0%
associate--l+99.0%
associate--l+99.0%
*-commutative99.0%
associate--l+99.0%
fma-define99.0%
*-commutative99.0%
associate-*l*89.5%
+-commutative89.5%
fma-define89.5%
Simplified89.5%
Taylor expanded in x around inf 45.9%
*-commutative45.9%
associate-*l*45.0%
Simplified45.0%
if 3.6499999999999998e-180 < c < 2.9000000000000002e74Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*97.9%
+-commutative97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in z around inf 50.5%
*-commutative50.5%
*-commutative50.5%
*-commutative50.5%
associate-*r*50.5%
Simplified50.5%
Final simplification55.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* t (* 2.0 z))))
(if (<= z -5e+136)
t_1
(if (<= z 8.8e-263)
(* x (* 2.0 y))
(if (<= z 2.7e-31) (* -2.0 (* a (* c i))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = t * (2.0 * z);
double tmp;
if (z <= -5e+136) {
tmp = t_1;
} else if (z <= 8.8e-263) {
tmp = x * (2.0 * y);
} else if (z <= 2.7e-31) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = t * (2.0d0 * z)
if (z <= (-5d+136)) then
tmp = t_1
else if (z <= 8.8d-263) then
tmp = x * (2.0d0 * y)
else if (z <= 2.7d-31) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = t * (2.0 * z);
double tmp;
if (z <= -5e+136) {
tmp = t_1;
} else if (z <= 8.8e-263) {
tmp = x * (2.0 * y);
} else if (z <= 2.7e-31) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = t * (2.0 * z) tmp = 0 if z <= -5e+136: tmp = t_1 elif z <= 8.8e-263: tmp = x * (2.0 * y) elif z <= 2.7e-31: tmp = -2.0 * (a * (c * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(t * Float64(2.0 * z)) tmp = 0.0 if (z <= -5e+136) tmp = t_1; elseif (z <= 8.8e-263) tmp = Float64(x * Float64(2.0 * y)); elseif (z <= 2.7e-31) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = t * (2.0 * z); tmp = 0.0; if (z <= -5e+136) tmp = t_1; elseif (z <= 8.8e-263) tmp = x * (2.0 * y); elseif (z <= 2.7e-31) tmp = -2.0 * (a * (c * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+136], t$95$1, If[LessEqual[z, 8.8e-263], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-31], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(2 \cdot z\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-263}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-31}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.0000000000000002e136 or 2.70000000000000014e-31 < z Initial program 91.6%
associate--l+91.6%
*-commutative91.6%
associate--l+91.6%
associate--l+91.6%
*-commutative91.6%
associate--l+91.6%
fma-define91.6%
*-commutative91.6%
associate-*l*93.4%
+-commutative93.4%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around inf 56.4%
*-commutative56.4%
*-commutative56.4%
*-commutative56.4%
associate-*r*56.4%
Simplified56.4%
if -5.0000000000000002e136 < z < 8.8000000000000001e-263Initial program 93.2%
associate--l+93.2%
*-commutative93.2%
associate--l+93.2%
associate--l+93.2%
*-commutative93.2%
associate--l+93.2%
fma-define93.2%
*-commutative93.2%
associate-*l*90.4%
+-commutative90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in x around inf 36.2%
*-commutative36.2%
associate-*l*35.2%
Simplified35.2%
if 8.8000000000000001e-263 < z < 2.70000000000000014e-31Initial program 99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
associate--l+99.9%
*-commutative99.9%
associate--l+99.9%
fma-define99.9%
*-commutative99.9%
associate-*l*96.2%
+-commutative96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in a around inf 33.7%
Final simplification43.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.8e+102) (not (<= c 7.8e+59))) (* -2.0 (* c (* (+ a (* b c)) i))) (* 2.0 (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4.8e+102) || !(c <= 7.8e+59)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-4.8d+102)) .or. (.not. (c <= 7.8d+59))) then
tmp = (-2.0d0) * (c * ((a + (b * c)) * i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -4.8e+102) || !(c <= 7.8e+59)) {
tmp = -2.0 * (c * ((a + (b * c)) * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -4.8e+102) or not (c <= 7.8e+59): tmp = -2.0 * (c * ((a + (b * c)) * i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -4.8e+102) || !(c <= 7.8e+59)) tmp = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -4.8e+102) || ~((c <= 7.8e+59))) tmp = -2.0 * (c * ((a + (b * c)) * i)); else tmp = 2.0 * ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -4.8e+102], N[Not[LessEqual[c, 7.8e+59]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.8 \cdot 10^{+102} \lor \neg \left(c \leq 7.8 \cdot 10^{+59}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -4.79999999999999989e102 or 7.80000000000000043e59 < c Initial program 85.5%
associate--l+85.5%
*-commutative85.5%
associate--l+85.5%
associate--l+85.5%
*-commutative85.5%
associate--l+85.5%
fma-define85.5%
*-commutative85.5%
associate-*l*94.1%
+-commutative94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in i around inf 83.5%
if -4.79999999999999989e102 < c < 7.80000000000000043e59Initial program 99.3%
associate--l+99.3%
*-commutative99.3%
associate--l+99.3%
associate--l+99.3%
*-commutative99.3%
associate--l+99.3%
fma-define99.3%
*-commutative99.3%
associate-*l*91.9%
+-commutative91.9%
fma-define91.9%
Simplified91.9%
Taylor expanded in c around 0 76.5%
Final simplification79.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= c -3.5e+104)
(* -2.0 (* c (* b (* c i))))
(if (<= c 2e+103)
(* 2.0 (+ (* x y) (* z t)))
(* -2.0 (* c (* (* b c) i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3.5e+104) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 2e+103) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (c <= (-3.5d+104)) then
tmp = (-2.0d0) * (c * (b * (c * i)))
else if (c <= 2d+103) then
tmp = 2.0d0 * ((x * y) + (z * t))
else
tmp = (-2.0d0) * (c * ((b * c) * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -3.5e+104) {
tmp = -2.0 * (c * (b * (c * i)));
} else if (c <= 2e+103) {
tmp = 2.0 * ((x * y) + (z * t));
} else {
tmp = -2.0 * (c * ((b * c) * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -3.5e+104: tmp = -2.0 * (c * (b * (c * i))) elif c <= 2e+103: tmp = 2.0 * ((x * y) + (z * t)) else: tmp = -2.0 * (c * ((b * c) * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -3.5e+104) tmp = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i)))); elseif (c <= 2e+103) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -3.5e+104) tmp = -2.0 * (c * (b * (c * i))); elseif (c <= 2e+103) tmp = 2.0 * ((x * y) + (z * t)); else tmp = -2.0 * (c * ((b * c) * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -3.5e+104], N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2e+103], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{+104}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2 \cdot 10^{+103}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -3.5000000000000002e104Initial program 87.2%
associate--l+87.2%
*-commutative87.2%
associate--l+87.2%
associate--l+87.2%
*-commutative87.2%
associate--l+87.2%
fma-define87.2%
*-commutative87.2%
associate-*l*97.7%
+-commutative97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in i around inf 91.4%
Taylor expanded in a around 0 78.6%
if -3.5000000000000002e104 < c < 2e103Initial program 98.7%
associate--l+98.7%
*-commutative98.7%
associate--l+98.7%
associate--l+98.7%
*-commutative98.7%
associate--l+98.7%
fma-define98.7%
*-commutative98.7%
associate-*l*92.5%
+-commutative92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in c around 0 74.2%
if 2e103 < c Initial program 82.2%
associate--l+82.2%
*-commutative82.2%
associate--l+82.2%
associate--l+82.2%
*-commutative82.2%
associate--l+82.2%
fma-define82.2%
*-commutative82.2%
associate-*l*88.8%
+-commutative88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in i around inf 80.0%
Taylor expanded in a around 0 66.6%
associate-*r*66.6%
*-commutative66.6%
associate-*l*66.5%
*-commutative66.5%
Simplified66.5%
Taylor expanded in c around 0 66.6%
associate-*r*66.6%
*-commutative66.6%
Simplified66.6%
Final simplification73.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -1.65e-159) (not (<= t 2.75e+54))) (* t (* 2.0 z)) (* x (* 2.0 y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.65e-159) || !(t <= 2.75e+54)) {
tmp = t * (2.0 * z);
} else {
tmp = x * (2.0 * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-1.65d-159)) .or. (.not. (t <= 2.75d+54))) then
tmp = t * (2.0d0 * z)
else
tmp = x * (2.0d0 * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.65e-159) || !(t <= 2.75e+54)) {
tmp = t * (2.0 * z);
} else {
tmp = x * (2.0 * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -1.65e-159) or not (t <= 2.75e+54): tmp = t * (2.0 * z) else: tmp = x * (2.0 * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -1.65e-159) || !(t <= 2.75e+54)) tmp = Float64(t * Float64(2.0 * z)); else tmp = Float64(x * Float64(2.0 * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -1.65e-159) || ~((t <= 2.75e+54))) tmp = t * (2.0 * z); else tmp = x * (2.0 * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -1.65e-159], N[Not[LessEqual[t, 2.75e+54]], $MachinePrecision]], N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-159} \lor \neg \left(t \leq 2.75 \cdot 10^{+54}\right):\\
\;\;\;\;t \cdot \left(2 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot y\right)\\
\end{array}
\end{array}
if t < -1.6500000000000001e-159 or 2.75000000000000013e54 < t Initial program 92.8%
associate--l+92.8%
*-commutative92.8%
associate--l+92.8%
associate--l+92.8%
*-commutative92.8%
associate--l+92.8%
fma-define92.8%
*-commutative92.8%
associate-*l*92.1%
+-commutative92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in z around inf 45.5%
*-commutative45.5%
*-commutative45.5%
*-commutative45.5%
associate-*r*45.5%
Simplified45.5%
if -1.6500000000000001e-159 < t < 2.75000000000000013e54Initial program 95.2%
associate--l+95.2%
*-commutative95.2%
associate--l+95.2%
associate--l+95.2%
*-commutative95.2%
associate--l+95.2%
fma-define95.2%
*-commutative95.2%
associate-*l*93.6%
+-commutative93.6%
fma-define93.6%
Simplified93.6%
Taylor expanded in x around inf 40.8%
*-commutative40.8%
associate-*l*40.0%
Simplified40.0%
Final simplification43.0%
(FPCore (x y z t a b c i) :precision binary64 (* t (* 2.0 z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = t * (2.0d0 * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t * (2.0 * z);
}
def code(x, y, z, t, a, b, c, i): return t * (2.0 * z)
function code(x, y, z, t, a, b, c, i) return Float64(t * Float64(2.0 * z)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t * (2.0 * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(2 \cdot z\right)
\end{array}
Initial program 93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
associate--l+93.9%
*-commutative93.9%
associate--l+93.9%
fma-define93.9%
*-commutative93.9%
associate-*l*92.8%
+-commutative92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in z around inf 30.3%
*-commutative30.3%
*-commutative30.3%
*-commutative30.3%
associate-*r*30.3%
Simplified30.3%
Final simplification30.3%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024145
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))