
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* x (* 2.0 (+ y (* t (/ z x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = x * (2.0 * (y + (t * (z / x)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(x * Float64(2.0 * Float64(y + Float64(t * Float64(z / x))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (x * y) + (z * t); tmp = 0.0; if ((t_2 - ((c * t_1) * i)) <= Inf) tmp = 2.0 * (t_2 - (t_1 * (c * i))); else tmp = x * (2.0 * (y + (t * (z / x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + t \cdot \frac{z}{x}\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 94.4%
fma-define94.4%
associate-*l*98.3%
Simplified98.3%
fma-define98.3%
+-commutative98.3%
Applied egg-rr98.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 c around 0 68.8%
Taylor expanded in x around inf 75.0%
distribute-lft-out75.0%
associate-/l*75.0%
Simplified75.0%
Final simplification96.8%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)))) (if (<= t_1 INFINITY) (* t_1 2.0) (* x (* 2.0 (+ y (* t (/ z x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 * 2.0;
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * 2.0;
} else {
tmp = x * (2.0 * (y + (t * (z / x))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 * 2.0 else: tmp = x * (2.0 * (y + (t * (z / x)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 * 2.0); else tmp = Float64(x * Float64(2.0 * Float64(y + Float64(t * Float64(z / x))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) - ((c * (a + (b * c))) * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 * 2.0; else tmp = x * (2.0 * (y + (t * (z / x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 * 2.0), $MachinePrecision], N[(x * N[(2.0 * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1 \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + t \cdot \frac{z}{x}\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 94.4%
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 0 68.8%
Taylor expanded in x around inf 75.0%
distribute-lft-out75.0%
associate-/l*75.0%
Simplified75.0%
Final simplification93.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (+ (* x y) (* z t))))
(if (<= c -1.35e-27)
(* 2.0 (- (* x y) t_1))
(if (<= c -3.5e-250)
(* 2.0 (- t_2 (* (* b c) (* c i))))
(if (<= c 2.1e+16)
(* 2.0 (- t_2 (* i (* a c))))
(* 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 t_2 = (x * y) + (z * t);
double tmp;
if (c <= -1.35e-27) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -3.5e-250) {
tmp = 2.0 * (t_2 - ((b * c) * (c * i)));
} else if (c <= 2.1e+16) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} 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) :: t_2
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = (x * y) + (z * t)
if (c <= (-1.35d-27)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= (-3.5d-250)) then
tmp = 2.0d0 * (t_2 - ((b * c) * (c * i)))
else if (c <= 2.1d+16) then
tmp = 2.0d0 * (t_2 - (i * (a * c)))
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 t_2 = (x * y) + (z * t);
double tmp;
if (c <= -1.35e-27) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -3.5e-250) {
tmp = 2.0 * (t_2 - ((b * c) * (c * i)));
} else if (c <= 2.1e+16) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} 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) t_2 = (x * y) + (z * t) tmp = 0 if c <= -1.35e-27: tmp = 2.0 * ((x * y) - t_1) elif c <= -3.5e-250: tmp = 2.0 * (t_2 - ((b * c) * (c * i))) elif c <= 2.1e+16: tmp = 2.0 * (t_2 - (i * (a * c))) 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)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (c <= -1.35e-27) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= -3.5e-250) tmp = Float64(2.0 * Float64(t_2 - Float64(Float64(b * c) * Float64(c * i)))); elseif (c <= 2.1e+16) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(a * c)))); 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); t_2 = (x * y) + (z * t); tmp = 0.0; if (c <= -1.35e-27) tmp = 2.0 * ((x * y) - t_1); elseif (c <= -3.5e-250) tmp = 2.0 * (t_2 - ((b * c) * (c * i))); elseif (c <= 2.1e+16) tmp = 2.0 * (t_2 - (i * (a * c))); 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]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.35e-27], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3.5e-250], N[(2.0 * N[(t$95$2 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+16], N[(2.0 * N[(t$95$2 - N[(i * N[(a * c), $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)\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -1.35 \cdot 10^{-27}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;c \leq -3.5 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(t\_2 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 2.1 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(t\_2 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if c < -1.34999999999999994e-27Initial program 81.1%
Taylor expanded in z around 0 85.0%
if -1.34999999999999994e-27 < c < -3.4999999999999999e-250Initial program 93.4%
fma-define93.4%
associate-*l*95.4%
Simplified95.4%
fma-define95.4%
+-commutative95.4%
Applied egg-rr95.4%
Taylor expanded in a around 0 96.6%
if -3.4999999999999999e-250 < c < 2.1e16Initial program 96.3%
Taylor expanded in a around inf 96.3%
*-commutative96.3%
Simplified96.3%
if 2.1e16 < c Initial program 82.7%
Taylor expanded in x around 0 88.6%
Final simplification91.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (+ (* x y) (* z t))))
(if (<= c -6.5e-27)
(* 2.0 (- (* x y) t_1))
(if (<= c -3.8e-250)
(* 2.0 (- t_2 (* i (* c (* b c)))))
(if (<= c 1.45e+16)
(* 2.0 (- t_2 (* i (* a c))))
(* 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 t_2 = (x * y) + (z * t);
double tmp;
if (c <= -6.5e-27) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -3.8e-250) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else if (c <= 1.45e+16) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} 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) :: t_2
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = (x * y) + (z * t)
if (c <= (-6.5d-27)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= (-3.8d-250)) then
tmp = 2.0d0 * (t_2 - (i * (c * (b * c))))
else if (c <= 1.45d+16) then
tmp = 2.0d0 * (t_2 - (i * (a * c)))
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 t_2 = (x * y) + (z * t);
double tmp;
if (c <= -6.5e-27) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= -3.8e-250) {
tmp = 2.0 * (t_2 - (i * (c * (b * c))));
} else if (c <= 1.45e+16) {
tmp = 2.0 * (t_2 - (i * (a * c)));
} 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) t_2 = (x * y) + (z * t) tmp = 0 if c <= -6.5e-27: tmp = 2.0 * ((x * y) - t_1) elif c <= -3.8e-250: tmp = 2.0 * (t_2 - (i * (c * (b * c)))) elif c <= 1.45e+16: tmp = 2.0 * (t_2 - (i * (a * c))) 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)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (c <= -6.5e-27) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= -3.8e-250) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(c * Float64(b * c))))); elseif (c <= 1.45e+16) tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(a * c)))); 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); t_2 = (x * y) + (z * t); tmp = 0.0; if (c <= -6.5e-27) tmp = 2.0 * ((x * y) - t_1); elseif (c <= -3.8e-250) tmp = 2.0 * (t_2 - (i * (c * (b * c)))); elseif (c <= 1.45e+16) tmp = 2.0 * (t_2 - (i * (a * c))); 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]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.5e-27], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3.8e-250], N[(2.0 * N[(t$95$2 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.45e+16], N[(2.0 * N[(t$95$2 - N[(i * N[(a * c), $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)\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -6.5 \cdot 10^{-27}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;c \leq -3.8 \cdot 10^{-250}:\\
\;\;\;\;2 \cdot \left(t\_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\
\mathbf{elif}\;c \leq 1.45 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(t\_2 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if c < -6.50000000000000025e-27Initial program 81.1%
Taylor expanded in z around 0 85.0%
if -6.50000000000000025e-27 < c < -3.79999999999999971e-250Initial program 93.4%
Taylor expanded in a around 0 94.6%
if -3.79999999999999971e-250 < c < 1.45e16Initial program 96.3%
Taylor expanded in a around inf 96.3%
*-commutative96.3%
Simplified96.3%
if 1.45e16 < c Initial program 82.7%
Taylor expanded in x around 0 88.6%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))) (t_2 (* x (* y 2.0))))
(if (<= x -5.8e+27)
t_2
(if (<= x -3.7e-79)
t_1
(if (<= x -3.7e-239)
(* -2.0 (* a (* c i)))
(if (<= x 2.55e-67) 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);
double t_2 = x * (y * 2.0);
double tmp;
if (x <= -5.8e+27) {
tmp = t_2;
} else if (x <= -3.7e-79) {
tmp = t_1;
} else if (x <= -3.7e-239) {
tmp = -2.0 * (a * (c * i));
} else if (x <= 2.55e-67) {
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)
t_2 = x * (y * 2.0d0)
if (x <= (-5.8d+27)) then
tmp = t_2
else if (x <= (-3.7d-79)) then
tmp = t_1
else if (x <= (-3.7d-239)) then
tmp = (-2.0d0) * (a * (c * i))
else if (x <= 2.55d-67) 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);
double t_2 = x * (y * 2.0);
double tmp;
if (x <= -5.8e+27) {
tmp = t_2;
} else if (x <= -3.7e-79) {
tmp = t_1;
} else if (x <= -3.7e-239) {
tmp = -2.0 * (a * (c * i));
} else if (x <= 2.55e-67) {
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) t_2 = x * (y * 2.0) tmp = 0 if x <= -5.8e+27: tmp = t_2 elif x <= -3.7e-79: tmp = t_1 elif x <= -3.7e-239: tmp = -2.0 * (a * (c * i)) elif x <= 2.55e-67: 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(z * t)) t_2 = Float64(x * Float64(y * 2.0)) tmp = 0.0 if (x <= -5.8e+27) tmp = t_2; elseif (x <= -3.7e-79) tmp = t_1; elseif (x <= -3.7e-239) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (x <= 2.55e-67) 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); t_2 = x * (y * 2.0); tmp = 0.0; if (x <= -5.8e+27) tmp = t_2; elseif (x <= -3.7e-79) tmp = t_1; elseif (x <= -3.7e-239) tmp = -2.0 * (a * (c * i)); elseif (x <= 2.55e-67) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e+27], t$95$2, If[LessEqual[x, -3.7e-79], t$95$1, If[LessEqual[x, -3.7e-239], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e-67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-239}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.8000000000000002e27 or 2.54999999999999991e-67 < x Initial program 87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
associate--l+87.6%
*-commutative87.6%
associate--l+87.6%
fma-define88.4%
*-commutative88.4%
associate-*l*89.0%
+-commutative89.0%
fma-define89.0%
Simplified89.0%
Taylor expanded in x around inf 43.4%
*-commutative43.4%
associate-*l*43.4%
*-commutative43.4%
Simplified43.4%
if -5.8000000000000002e27 < x < -3.70000000000000018e-79 or -3.70000000000000015e-239 < x < 2.54999999999999991e-67Initial program 88.4%
Taylor expanded in z around inf 42.8%
if -3.70000000000000018e-79 < x < -3.70000000000000015e-239Initial program 91.9%
associate--l+91.9%
*-commutative91.9%
associate--l+91.9%
associate--l+91.9%
*-commutative91.9%
associate--l+91.9%
fma-define91.9%
*-commutative91.9%
associate-*l*84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
Taylor expanded in a around inf 38.5%
*-commutative38.5%
Simplified38.5%
Final simplification42.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -5.2e+52) (not (<= c 1.48e+15))) (* 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 <= -5.2e+52) || !(c <= 1.48e+15)) {
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 <= (-5.2d+52)) .or. (.not. (c <= 1.48d+15))) 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 <= -5.2e+52) || !(c <= 1.48e+15)) {
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 <= -5.2e+52) or not (c <= 1.48e+15): 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 <= -5.2e+52) || !(c <= 1.48e+15)) 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 <= -5.2e+52) || ~((c <= 1.48e+15))) 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, -5.2e+52], N[Not[LessEqual[c, 1.48e+15]], $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 -5.2 \cdot 10^{+52} \lor \neg \left(c \leq 1.48 \cdot 10^{+15}\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 < -5.2e52 or 1.48e15 < c Initial program 80.5%
Taylor expanded in x around 0 88.7%
if -5.2e52 < c < 1.48e15Initial program 95.0%
Taylor expanded in a around inf 90.1%
*-commutative90.1%
Simplified90.1%
Final simplification89.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -2.9e-28) (not (<= c 19500.0))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.9e-28) || !(c <= 19500.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-2.9d-28)) .or. (.not. (c <= 19500.0d0))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -2.9e-28) || !(c <= 19500.0)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -2.9e-28) or not (c <= 19500.0): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -2.9e-28) || !(c <= 19500.0)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -2.9e-28) || ~((c <= 19500.0))) tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.9e-28], N[Not[LessEqual[c, 19500.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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.9 \cdot 10^{-28} \lor \neg \left(c \leq 19500\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -2.90000000000000013e-28 or 19500 < c Initial program 82.5%
Taylor expanded in x around 0 86.1%
if -2.90000000000000013e-28 < c < 19500Initial program 95.1%
Taylor expanded in c around 0 85.0%
Final simplification85.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -4.2e-28)
(* 2.0 (- (* x y) t_1))
(if (<= c 13200.0) (* (+ (* x y) (* z t)) 2.0) (* 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 <= -4.2e-28) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 13200.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} 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 <= (-4.2d-28)) then
tmp = 2.0d0 * ((x * y) - t_1)
else if (c <= 13200.0d0) then
tmp = ((x * y) + (z * t)) * 2.0d0
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 <= -4.2e-28) {
tmp = 2.0 * ((x * y) - t_1);
} else if (c <= 13200.0) {
tmp = ((x * y) + (z * t)) * 2.0;
} 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 <= -4.2e-28: tmp = 2.0 * ((x * y) - t_1) elif c <= 13200.0: tmp = ((x * y) + (z * t)) * 2.0 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 <= -4.2e-28) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); elseif (c <= 13200.0) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); 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 <= -4.2e-28) tmp = 2.0 * ((x * y) - t_1); elseif (c <= 13200.0) tmp = ((x * y) + (z * t)) * 2.0; 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, -4.2e-28], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 13200.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $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 -4.2 \cdot 10^{-28}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{elif}\;c \leq 13200:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if c < -4.20000000000000013e-28Initial program 81.1%
Taylor expanded in z around 0 85.0%
if -4.20000000000000013e-28 < c < 13200Initial program 95.1%
Taylor expanded in c around 0 85.0%
if 13200 < c Initial program 84.0%
Taylor expanded in x around 0 88.0%
Final simplification85.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -7e-27) (not (<= c 29500.0))) (* (* 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 <= -7e-27) || !(c <= 29500.0)) {
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 <= (-7d-27)) .or. (.not. (c <= 29500.0d0))) 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 <= -7e-27) || !(c <= 29500.0)) {
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 <= -7e-27) or not (c <= 29500.0): 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 <= -7e-27) || !(c <= 29500.0)) 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 <= -7e-27) || ~((c <= 29500.0))) 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, -7e-27], N[Not[LessEqual[c, 29500.0]], $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 -7 \cdot 10^{-27} \lor \neg \left(c \leq 29500\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 < -7.0000000000000003e-27 or 29500 < c Initial program 82.5%
associate--l+82.5%
*-commutative82.5%
associate--l+82.5%
associate--l+82.5%
*-commutative82.5%
associate--l+82.5%
fma-define83.3%
*-commutative83.3%
associate-*l*92.5%
+-commutative92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in i around inf 78.5%
if -7.0000000000000003e-27 < c < 29500Initial program 95.1%
Taylor expanded in c around 0 85.0%
Final simplification81.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.8e+53) (not (<= c 3.35e+16))) (* i (* (* c (* b c)) -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 <= -4.8e+53) || !(c <= 3.35e+16)) {
tmp = i * ((c * (b * c)) * -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 <= (-4.8d+53)) .or. (.not. (c <= 3.35d+16))) then
tmp = i * ((c * (b * c)) * (-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 <= -4.8e+53) || !(c <= 3.35e+16)) {
tmp = i * ((c * (b * c)) * -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 <= -4.8e+53) or not (c <= 3.35e+16): tmp = i * ((c * (b * c)) * -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 <= -4.8e+53) || !(c <= 3.35e+16)) tmp = Float64(i * Float64(Float64(c * Float64(b * c)) * -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 <= -4.8e+53) || ~((c <= 3.35e+16))) tmp = i * ((c * (b * c)) * -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, -4.8e+53], N[Not[LessEqual[c, 3.35e+16]], $MachinePrecision]], N[(i * N[(N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision] * -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 -4.8 \cdot 10^{+53} \lor \neg \left(c \leq 3.35 \cdot 10^{+16}\right):\\
\;\;\;\;i \cdot \left(\left(c \cdot \left(b \cdot c\right)\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -4.8e53 or 3.35e16 < 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-define81.4%
*-commutative81.4%
associate-*l*91.4%
+-commutative91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in i around inf 76.3%
Taylor expanded in i around inf 76.2%
Taylor expanded in a around 0 61.5%
if -4.8e53 < c < 3.35e16Initial program 95.0%
Taylor expanded in c around 0 78.1%
Final simplification70.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.05e+205) (not (<= c 235000.0))) (* -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 ((c <= -1.05e+205) || !(c <= 235000.0)) {
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 ((c <= (-1.05d+205)) .or. (.not. (c <= 235000.0d0))) 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 ((c <= -1.05e+205) || !(c <= 235000.0)) {
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 (c <= -1.05e+205) or not (c <= 235000.0): 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 ((c <= -1.05e+205) || !(c <= 235000.0)) 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 ((c <= -1.05e+205) || ~((c <= 235000.0))) 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[c, -1.05e+205], N[Not[LessEqual[c, 235000.0]], $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}\;c \leq -1.05 \cdot 10^{+205} \lor \neg \left(c \leq 235000\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 c < -1.05e205 or 235000 < c Initial program 83.5%
associate--l+83.5%
*-commutative83.5%
associate--l+83.5%
associate--l+83.5%
*-commutative83.5%
associate--l+83.5%
fma-define84.6%
*-commutative84.6%
associate-*l*94.4%
+-commutative94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in a around inf 40.8%
*-commutative40.8%
Simplified40.8%
if -1.05e205 < c < 235000Initial program 91.2%
Taylor expanded in c around 0 71.8%
Final simplification61.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -2e+112) (not (<= z 8.8e-63))) (* 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 ((z <= -2e+112) || !(z <= 8.8e-63)) {
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 ((z <= (-2d+112)) .or. (.not. (z <= 8.8d-63))) 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 ((z <= -2e+112) || !(z <= 8.8e-63)) {
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 (z <= -2e+112) or not (z <= 8.8e-63): 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 ((z <= -2e+112) || !(z <= 8.8e-63)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(x * Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -2e+112) || ~((z <= 8.8e-63))) 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[z, -2e+112], N[Not[LessEqual[z, 8.8e-63]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+112} \lor \neg \left(z \leq 8.8 \cdot 10^{-63}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\
\end{array}
\end{array}
if z < -1.9999999999999999e112 or 8.7999999999999998e-63 < z Initial program 87.5%
Taylor expanded in z around inf 43.4%
if -1.9999999999999999e112 < z < 8.7999999999999998e-63Initial program 89.3%
associate--l+89.3%
*-commutative89.3%
associate--l+89.3%
associate--l+89.3%
*-commutative89.3%
associate--l+89.3%
fma-define89.3%
*-commutative89.3%
associate-*l*90.5%
+-commutative90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in x around inf 37.0%
*-commutative37.0%
associate-*l*37.0%
*-commutative37.0%
Simplified37.0%
Final simplification39.8%
(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 88.5%
Taylor expanded in z around inf 27.5%
Final simplification27.5%
(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 2024137
(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))))