
(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
(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 (* (pow c 2.0) (- (/ (* a i) (- c)) (* b 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 * (pow(c, 2.0) * (((a * i) / -c) - (b * 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 * Float64((c ^ 2.0) * Float64(Float64(Float64(a * i) / Float64(-c)) - Float64(b * 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[(N[Power[c, 2.0], $MachinePrecision] * N[(N[(N[(a * i), $MachinePrecision] / (-c)), $MachinePrecision] - N[(b * i), $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 \left({c}^{2} \cdot \left(\frac{a \cdot i}{-c} - b \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 93.4%
fma-define93.4%
associate-*l*99.5%
Simplified99.5%
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 c around inf 63.7%
associate-*r/63.7%
mul-1-neg63.7%
*-commutative63.7%
Simplified63.7%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= (* x y) -1e+264)
(* (* x y) 2.0)
(if (<= (* x y) -2.5e+175)
t_1
(if (<= (* x y) -100000000000.0)
(* 2.0 (* t (+ z (/ (* x y) t))))
(if (<= (* x y) 4e-31) t_1 (* (+ (* 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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if ((x * y) <= -1e+264) {
tmp = (x * y) * 2.0;
} else if ((x * y) <= -2.5e+175) {
tmp = t_1;
} else if ((x * y) <= -100000000000.0) {
tmp = 2.0 * (t * (z + ((x * y) / t)));
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
if ((x * y) <= (-1d+264)) then
tmp = (x * y) * 2.0d0
else if ((x * y) <= (-2.5d+175)) then
tmp = t_1
else if ((x * y) <= (-100000000000.0d0)) then
tmp = 2.0d0 * (t * (z + ((x * y) / t)))
else if ((x * y) <= 4d-31) then
tmp = t_1
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 t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
double tmp;
if ((x * y) <= -1e+264) {
tmp = (x * y) * 2.0;
} else if ((x * y) <= -2.5e+175) {
tmp = t_1;
} else if ((x * y) <= -100000000000.0) {
tmp = 2.0 * (t * (z + ((x * y) / t)));
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if (x * y) <= -1e+264: tmp = (x * y) * 2.0 elif (x * y) <= -2.5e+175: tmp = t_1 elif (x * y) <= -100000000000.0: tmp = 2.0 * (t * (z + ((x * y) / t))) elif (x * y) <= 4e-31: tmp = t_1 else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (Float64(x * y) <= -1e+264) tmp = Float64(Float64(x * y) * 2.0); elseif (Float64(x * y) <= -2.5e+175) tmp = t_1; elseif (Float64(x * y) <= -100000000000.0) tmp = Float64(2.0 * Float64(t * Float64(z + Float64(Float64(x * y) / t)))); elseif (Float64(x * y) <= 4e-31) tmp = t_1; 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) t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); tmp = 0.0; if ((x * y) <= -1e+264) tmp = (x * y) * 2.0; elseif ((x * y) <= -2.5e+175) tmp = t_1; elseif ((x * y) <= -100000000000.0) tmp = 2.0 * (t * (z + ((x * y) / t))); elseif ((x * y) <= 4e-31) tmp = t_1; else tmp = ((x * y) + (z * t)) * 2.0; 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[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+264], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+175], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -100000000000.0], N[(2.0 * N[(t * N[(z + N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e-31], t$95$1, N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+264}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{+175}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -100000000000:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z + \frac{x \cdot y}{t}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000004e264Initial program 84.0%
Taylor expanded in x around inf 85.2%
if -1.00000000000000004e264 < (*.f64 x y) < -2.5e175 or -1e11 < (*.f64 x y) < 4e-31Initial program 89.5%
Taylor expanded in x around 0 87.1%
if -2.5e175 < (*.f64 x y) < -1e11Initial program 91.1%
Taylor expanded in z around inf 71.5%
Taylor expanded in c around 0 59.2%
Taylor expanded in t around inf 76.2%
if 4e-31 < (*.f64 x y) Initial program 90.2%
Taylor expanded in c around 0 73.2%
Final simplification82.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* c (* t_1 i))) (t_3 (* c t_1)))
(if (<= t_3 (- INFINITY))
(* 2.0 (- (* z t) t_2))
(if (<= t_3 2e+277)
(* (- (+ (* x y) (* z t)) (* t_3 i)) 2.0)
(* 2.0 (- (* x y) t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 2e+277) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = c * (t_1 * i);
double t_3 = c * t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - t_2);
} else if (t_3 <= 2e+277) {
tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0;
} else {
tmp = 2.0 * ((x * y) - t_2);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = c * (t_1 * i) t_3 = c * t_1 tmp = 0 if t_3 <= -math.inf: tmp = 2.0 * ((z * t) - t_2) elif t_3 <= 2e+277: tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0 else: tmp = 2.0 * ((x * y) - t_2) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(c * Float64(t_1 * i)) t_3 = Float64(c * t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_2)); elseif (t_3 <= 2e+277) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_3 * i)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = c * (t_1 * i); t_3 = c * t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = 2.0 * ((z * t) - t_2); elseif (t_3 <= 2e+277) tmp = (((x * y) + (z * t)) - (t_3 * i)) * 2.0; else tmp = 2.0 * ((x * y) - t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+277], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot \left(t\_1 \cdot i\right)\\
t_3 := c \cdot t\_1\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_3 \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_2\right)\\
\end{array}
\end{array}
if (*.f64 (+.f64 a (*.f64 b c)) c) < -inf.0Initial program 66.7%
Taylor expanded in x around 0 90.2%
if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.00000000000000001e277Initial program 98.8%
if 2.00000000000000001e277 < (*.f64 (+.f64 a (*.f64 b c)) c) Initial program 72.0%
Taylor expanded in z around 0 90.5%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -2.2e-67)
(* 2.0 (- (* x y) t_1))
(if (<= c 1.9e-91)
(* (+ (* x y) (* z t)) 2.0)
(if (or (<= c 5.9e+82) (not (<= c 7e+104)))
(* 2.0 (- (* z t) t_1))
(* (* x y) 2.0))))))
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 tmp;
if (c <= -2.2e-67) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 1.9e-91) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 5.9e+82) || !(c <= 7e+104)) {
tmp = 2.0 * ((z * t) - t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-2.2d-67)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 1.9d-91) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((c <= 5.9d+82) .or. (.not. (c <= 7d+104))) then
tmp = 2.0d0 * ((z * t) - t_1)
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 t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -2.2e-67) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 1.9e-91) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((c <= 5.9e+82) || !(c <= 7e+104)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -2.2e-67: tmp = 2.0 * ((x * y) - t_1) elif c <= 1.9e-91: tmp = ((x * y) + (z * t)) * 2.0 elif (c <= 5.9e+82) or not (c <= 7e+104): tmp = 2.0 * ((z * t) - t_1) else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -2.2e-67) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 1.9e-91) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif ((c <= 5.9e+82) || !(c <= 7e+104)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -2.2e-67) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 1.9e-91) tmp = ((x * y) + (z * t)) * 2.0; elseif ((c <= 5.9e+82) || ~((c <= 7e+104))) tmp = 2.0 * ((z * t) - t_1); else tmp = (x * y) * 2.0; 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]}, If[LessEqual[c, -2.2e-67], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.9e-91], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[Or[LessEqual[c, 5.9e+82], N[Not[LessEqual[c, 7e+104]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -2.2 \cdot 10^{-67}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;c \leq 1.9 \cdot 10^{-91}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 5.9 \cdot 10^{+82} \lor \neg \left(c \leq 7 \cdot 10^{+104}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.2000000000000001e-67Initial program 83.9%
Taylor expanded in z around 0 83.3%
if -2.2000000000000001e-67 < c < 1.89999999999999989e-91Initial program 98.9%
Taylor expanded in c around 0 87.0%
if 1.89999999999999989e-91 < c < 5.8999999999999997e82 or 7.0000000000000003e104 < c Initial program 83.4%
Taylor expanded in x around 0 86.7%
if 5.8999999999999997e82 < c < 7.0000000000000003e104Initial program 80.0%
Taylor expanded in x around inf 100.0%
Final simplification85.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= i -100000.0) (not (<= i 2.05e+115)))
(* (- t_1 (* (* c (+ a (* b c))) i)) 2.0)
(* 2.0 (- t_1 (* c (+ (* a i) (* 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);
double tmp;
if ((i <= -100000.0) || !(i <= 2.05e+115)) {
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((i <= (-100000.0d0)) .or. (.not. (i <= 2.05d+115))) then
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0d0
else
tmp = 2.0d0 * (t_1 - (c * ((a * i) + (b * (c * i)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((i <= -100000.0) || !(i <= 2.05e+115)) {
tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0;
} else {
tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (i <= -100000.0) or not (i <= 2.05e+115): tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0 else: tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i))))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((i <= -100000.0) || !(i <= 2.05e+115)) tmp = Float64(Float64(t_1 - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) * 2.0); else tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(Float64(a * i) + Float64(b * Float64(c * i)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((i <= -100000.0) || ~((i <= 2.05e+115))) tmp = (t_1 - ((c * (a + (b * c))) * i)) * 2.0; else tmp = 2.0 * (t_1 - (c * ((a * i) + (b * (c * i))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[i, -100000.0], N[Not[LessEqual[i, 2.05e+115]], $MachinePrecision]], N[(N[(t$95$1 - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(N[(a * i), $MachinePrecision] + N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;i \leq -100000 \lor \neg \left(i \leq 2.05 \cdot 10^{+115}\right):\\
\;\;\;\;\left(t\_1 - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if i < -1e5 or 2.04999999999999981e115 < i Initial program 92.5%
if -1e5 < i < 2.04999999999999981e115Initial program 87.1%
Taylor expanded in c around 0 99.2%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -6.8e-65)
(* 2.0 (- (* x y) t_1))
(if (<= c 7.2e+104)
(* 2.0 (- (* z (+ t (/ (* x y) z))) (* a (* c i))))
(* 2.0 (- (* z t) t_1))))))
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 tmp;
if (c <= -6.8e-65) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 7.2e+104) {
tmp = 2.0 * ((z * (t + ((x * y) / z))) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - 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 = c * ((a + (b * c)) * i)
if (c <= (-6.8d-65)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 7.2d+104) then
tmp = 2.0d0 * ((z * (t + ((x * y) / z))) - (a * (c * i)))
else
tmp = 2.0d0 * ((z * t) - 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 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -6.8e-65) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 7.2e+104) {
tmp = 2.0 * ((z * (t + ((x * y) / z))) - (a * (c * i)));
} else {
tmp = 2.0 * ((z * t) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -6.8e-65: tmp = 2.0 * ((x * y) - t_1) elif c <= 7.2e+104: tmp = 2.0 * ((z * (t + ((x * y) / z))) - (a * (c * i))) else: tmp = 2.0 * ((z * t) - t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -6.8e-65) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 7.2e+104) tmp = Float64(2.0 * Float64(Float64(z * Float64(t + Float64(Float64(x * y) / z))) - Float64(a * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = c * ((a + (b * c)) * i); tmp = 0.0; if (c <= -6.8e-65) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 7.2e+104) tmp = 2.0 * ((z * (t + ((x * y) / z))) - (a * (c * i))); else tmp = 2.0 * ((z * t) - t_1); 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]}, If[LessEqual[c, -6.8e-65], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.2e+104], N[(2.0 * N[(N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{-65}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;c \leq 7.2 \cdot 10^{+104}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t + \frac{x \cdot y}{z}\right) - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if c < -6.79999999999999973e-65Initial program 83.9%
Taylor expanded in z around 0 83.3%
if -6.79999999999999973e-65 < c < 7.20000000000000001e104Initial program 96.9%
Taylor expanded in z around inf 78.9%
Taylor expanded in c around 0 83.5%
if 7.20000000000000001e104 < c Initial program 78.3%
Taylor expanded in x around 0 93.3%
Final simplification85.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.2e+147) (not (<= c 2e+113))) (* (* c (* (+ a (* b c)) i)) -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 ((c <= -6.2e+147) || !(c <= 2e+113)) {
tmp = (c * ((a + (b * c)) * i)) * -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 ((c <= (-6.2d+147)) .or. (.not. (c <= 2d+113))) then
tmp = (c * ((a + (b * c)) * i)) * (-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 ((c <= -6.2e+147) || !(c <= 2e+113)) {
tmp = (c * ((a + (b * c)) * i)) * -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 (c <= -6.2e+147) or not (c <= 2e+113): tmp = (c * ((a + (b * c)) * i)) * -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 ((c <= -6.2e+147) || !(c <= 2e+113)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -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 ((c <= -6.2e+147) || ~((c <= 2e+113))) tmp = (c * ((a + (b * c)) * i)) * -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[Or[LessEqual[c, -6.2e+147], N[Not[LessEqual[c, 2e+113]], $MachinePrecision]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $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 -6.2 \cdot 10^{+147} \lor \neg \left(c \leq 2 \cdot 10^{+113}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -6.2000000000000001e147 or 2e113 < c Initial program 76.2%
associate--l+76.2%
*-commutative76.2%
associate--l+76.2%
associate--l+76.2%
*-commutative76.2%
associate--l+76.2%
fma-define76.2%
*-commutative76.2%
associate-*l*90.8%
+-commutative90.8%
fma-define90.8%
Simplified90.8%
Taylor expanded in i around inf 87.6%
if -6.2000000000000001e147 < c < 2e113Initial program 95.0%
Taylor expanded in c around 0 73.9%
Final simplification78.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= t -2.2e-122)
t_1
(if (<= t 3.8e-241)
(* (* c i) (* a -2.0))
(if (<= t 3.4e+90) (* (* x y) 2.0) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (t <= -2.2e-122) {
tmp = t_1;
} else if (t <= 3.8e-241) {
tmp = (c * i) * (a * -2.0);
} else if (t <= 3.4e+90) {
tmp = (x * y) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
if (t <= (-2.2d-122)) then
tmp = t_1
else if (t <= 3.8d-241) then
tmp = (c * i) * (a * (-2.0d0))
else if (t <= 3.4d+90) then
tmp = (x * y) * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double tmp;
if (t <= -2.2e-122) {
tmp = t_1;
} else if (t <= 3.8e-241) {
tmp = (c * i) * (a * -2.0);
} else if (t <= 3.4e+90) {
tmp = (x * y) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) tmp = 0 if t <= -2.2e-122: tmp = t_1 elif t <= 3.8e-241: tmp = (c * i) * (a * -2.0) elif t <= 3.4e+90: tmp = (x * y) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) tmp = 0.0 if (t <= -2.2e-122) tmp = t_1; elseif (t <= 3.8e-241) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (t <= 3.4e+90) tmp = Float64(Float64(x * y) * 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 2.0 * (z * t); tmp = 0.0; if (t <= -2.2e-122) tmp = t_1; elseif (t <= 3.8e-241) tmp = (c * i) * (a * -2.0); elseif (t <= 3.4e+90) tmp = (x * y) * 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e-122], t$95$1, If[LessEqual[t, 3.8e-241], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+90], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-241}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+90}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.2e-122 or 3.40000000000000018e90 < t Initial program 89.1%
Taylor expanded in z around inf 44.1%
if -2.2e-122 < t < 3.7999999999999999e-241Initial program 88.8%
associate--l+88.8%
*-commutative88.8%
associate--l+88.8%
associate--l+88.8%
*-commutative88.8%
associate--l+88.8%
fma-define88.8%
*-commutative88.8%
associate-*l*91.1%
+-commutative91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in a around inf 37.8%
associate-*r*37.8%
Simplified37.8%
if 3.7999999999999999e-241 < t < 3.40000000000000018e90Initial program 90.3%
Taylor expanded in x around inf 45.8%
Final simplification43.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -3.6e+212) (not (<= c 5.1e+118))) (* (* 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 ((c <= -3.6e+212) || !(c <= 5.1e+118)) {
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 ((c <= (-3.6d+212)) .or. (.not. (c <= 5.1d+118))) 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 ((c <= -3.6e+212) || !(c <= 5.1e+118)) {
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 (c <= -3.6e+212) or not (c <= 5.1e+118): 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 ((c <= -3.6e+212) || !(c <= 5.1e+118)) 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 ((c <= -3.6e+212) || ~((c <= 5.1e+118))) 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[Or[LessEqual[c, -3.6e+212], N[Not[LessEqual[c, 5.1e+118]], $MachinePrecision]], 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}\;c \leq -3.6 \cdot 10^{+212} \lor \neg \left(c \leq 5.1 \cdot 10^{+118}\right):\\
\;\;\;\;\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 c < -3.6e212 or 5.10000000000000002e118 < c Initial program 80.5%
associate--l+80.5%
*-commutative80.5%
associate--l+80.5%
associate--l+80.5%
*-commutative80.5%
associate--l+80.5%
fma-define80.5%
*-commutative80.5%
associate-*l*94.8%
+-commutative94.8%
fma-define94.8%
Simplified94.8%
Taylor expanded in a around inf 48.2%
associate-*r*48.2%
Simplified48.2%
if -3.6e212 < c < 5.10000000000000002e118Initial program 92.0%
Taylor expanded in c around 0 70.2%
Final simplification65.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -2.9e-72) (not (<= t 5.9e+91))) (* 2.0 (* z t)) (* (* 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 ((t <= -2.9e-72) || !(t <= 5.9e+91)) {
tmp = 2.0 * (z * t);
} 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 ((t <= (-2.9d-72)) .or. (.not. (t <= 5.9d+91))) then
tmp = 2.0d0 * (z * t)
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 ((t <= -2.9e-72) || !(t <= 5.9e+91)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -2.9e-72) or not (t <= 5.9e+91): tmp = 2.0 * (z * t) else: tmp = (x * y) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -2.9e-72) || !(t <= 5.9e+91)) tmp = Float64(2.0 * Float64(z * t)); 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 ((t <= -2.9e-72) || ~((t <= 5.9e+91))) tmp = 2.0 * (z * t); else tmp = (x * y) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -2.9e-72], N[Not[LessEqual[t, 5.9e+91]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-72} \lor \neg \left(t \leq 5.9 \cdot 10^{+91}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if t < -2.89999999999999998e-72 or 5.9000000000000002e91 < t Initial program 88.5%
Taylor expanded in z around inf 45.1%
if -2.89999999999999998e-72 < t < 5.9000000000000002e91Initial program 90.4%
Taylor expanded in x around inf 44.9%
Final simplification45.0%
(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 89.4%
Taylor expanded in z around inf 30.7%
Final simplification30.7%
(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 2024111
(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))))