
(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))))
(if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
(* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
(* 2.0 (* (* t_1 i) (- c))))))
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 * ((t_1 * i) * -c);
}
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(Float64(t_1 * i) * Float64(-c))); 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[(t$95$1 * i), $MachinePrecision] * (-c)), $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(\left(t_1 \cdot i\right) \cdot \left(-c\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.9%
associate--l+94.9%
*-commutative94.9%
associate--l+94.9%
associate--l+94.9%
*-commutative94.9%
associate--l+94.9%
fma-def94.9%
associate-*l*98.3%
Simplified98.3%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in i around inf 64.3%
Final simplification96.5%
(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 (* t_1 i)))
(if (<= t_2 (- INFINITY))
(* 2.0 (- (* z t) (* c t_3)))
(if (<= t_2 1e+260)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* 2.0 (* t_3 (- c)))))))
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 = t_1 * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * ((z * t) - (c * t_3));
} else if (t_2 <= 1e+260) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * (t_3 * -c);
}
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 = t_1 * i;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((z * t) - (c * t_3));
} else if (t_2 <= 1e+260) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = 2.0 * (t_3 * -c);
}
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 = t_1 * i tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * ((z * t) - (c * t_3)) elif t_2 <= 1e+260: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = 2.0 * (t_3 * -c) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) t_3 = Float64(t_1 * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * t_3))); elseif (t_2 <= 1e+260) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(2.0 * Float64(t_3 * Float64(-c))); 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 = t_1 * i; tmp = 0.0; if (t_2 <= -Inf) tmp = 2.0 * ((z * t) - (c * t_3)); elseif (t_2 <= 1e+260) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = 2.0 * (t_3 * -c); 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[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+260], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(t$95$3 * (-c)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
t_3 := t_1 \cdot i\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot t_3\right)\\
\mathbf{elif}\;t_2 \leq 10^{+260}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(-c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 80.0%
Taylor expanded in x around 0 94.3%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000007e260Initial program 99.9%
if 1.00000000000000007e260 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 67.3%
Taylor expanded in i around inf 85.6%
Final simplification96.1%
(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))))
(* 2.0 (* (* t_1 i) (- c))))))
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 = 2.0 * ((t_1 * i) * -c);
}
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 = 2.0 * ((t_1 * i) * -c);
}
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 = 2.0 * ((t_1 * i) * -c) 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(2.0 * Float64(Float64(t_1 * i) * Float64(-c))); 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 = 2.0 * ((t_1 * i) * -c); 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[(2.0 * N[(N[(t$95$1 * i), $MachinePrecision] * (-c)), $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}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot i\right) \cdot \left(-c\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.9%
associate--l+94.9%
*-commutative94.9%
associate--l+94.9%
associate--l+94.9%
*-commutative94.9%
associate--l+94.9%
fma-def94.9%
associate-*l*98.3%
Simplified98.3%
fma-def98.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 i around inf 64.3%
Final simplification96.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* 2.0 (* (* (+ a (* b c)) i) (- c)))))
(if (<= c -8.2e-22)
t_2
(if (<= c 3.8e+43)
t_1
(if (<= c 3.95e+90)
t_2
(if (<= c 4.7e+104)
t_1
(if (<= c 3.7e+154)
(* 2.0 (- (* z t) (* c (* b (* c i)))))
t_2)))))))
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)) * 2.0;
double t_2 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -8.2e-22) {
tmp = t_2;
} else if (c <= 3.8e+43) {
tmp = t_1;
} else if (c <= 3.95e+90) {
tmp = t_2;
} else if (c <= 4.7e+104) {
tmp = t_1;
} else if (c <= 3.7e+154) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} 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 = ((x * y) + (z * t)) * 2.0d0
t_2 = 2.0d0 * (((a + (b * c)) * i) * -c)
if (c <= (-8.2d-22)) then
tmp = t_2
else if (c <= 3.8d+43) then
tmp = t_1
else if (c <= 3.95d+90) then
tmp = t_2
else if (c <= 4.7d+104) then
tmp = t_1
else if (c <= 3.7d+154) then
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
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 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (((a + (b * c)) * i) * -c);
double tmp;
if (c <= -8.2e-22) {
tmp = t_2;
} else if (c <= 3.8e+43) {
tmp = t_1;
} else if (c <= 3.95e+90) {
tmp = t_2;
} else if (c <= 4.7e+104) {
tmp = t_1;
} else if (c <= 3.7e+154) {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = 2.0 * (((a + (b * c)) * i) * -c) tmp = 0 if c <= -8.2e-22: tmp = t_2 elif c <= 3.8e+43: tmp = t_1 elif c <= 3.95e+90: tmp = t_2 elif c <= 4.7e+104: tmp = t_1 elif c <= 3.7e+154: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))) tmp = 0.0 if (c <= -8.2e-22) tmp = t_2; elseif (c <= 3.8e+43) tmp = t_1; elseif (c <= 3.95e+90) tmp = t_2; elseif (c <= 4.7e+104) tmp = t_1; elseif (c <= 3.7e+154) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((x * y) + (z * t)) * 2.0; t_2 = 2.0 * (((a + (b * c)) * i) * -c); tmp = 0.0; if (c <= -8.2e-22) tmp = t_2; elseif (c <= 3.8e+43) tmp = t_1; elseif (c <= 3.95e+90) tmp = t_2; elseif (c <= 4.7e+104) tmp = t_1; elseif (c <= 3.7e+154) tmp = 2.0 * ((z * t) - (c * (b * (c * i)))); else tmp = t_2; 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] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.2e-22], t$95$2, If[LessEqual[c, 3.8e+43], t$95$1, If[LessEqual[c, 3.95e+90], t$95$2, If[LessEqual[c, 4.7e+104], t$95$1, If[LessEqual[c, 3.7e+154], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := 2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{if}\;c \leq -8.2 \cdot 10^{-22}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 3.8 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.95 \cdot 10^{+90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 4.7 \cdot 10^{+104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 3.7 \cdot 10^{+154}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c < -8.1999999999999999e-22 or 3.80000000000000008e43 < c < 3.9499999999999998e90 or 3.69999999999999994e154 < c Initial program 81.7%
Taylor expanded in i around inf 80.6%
if -8.1999999999999999e-22 < c < 3.80000000000000008e43 or 3.9499999999999998e90 < c < 4.70000000000000017e104Initial program 97.6%
Taylor expanded in c around 0 83.2%
if 4.70000000000000017e104 < c < 3.69999999999999994e154Initial program 85.2%
Taylor expanded in x around 0 92.8%
Taylor expanded in a around 0 85.3%
Final simplification82.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -2.6e+48)
t_1
(if (<= (* x y) 3.7e-267)
(* 2.0 (* z t))
(if (<= (* x y) 1.22e+89) (* 2.0 (* (- c) (* a i))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.6e+48) {
tmp = t_1;
} else if ((x * y) <= 3.7e-267) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1.22e+89) {
tmp = 2.0 * (-c * (a * 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 = (x * y) * 2.0d0
if ((x * y) <= (-2.6d+48)) then
tmp = t_1
else if ((x * y) <= 3.7d-267) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 1.22d+89) then
tmp = 2.0d0 * (-c * (a * 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.6e+48) {
tmp = t_1;
} else if ((x * y) <= 3.7e-267) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1.22e+89) {
tmp = 2.0 * (-c * (a * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2.6e+48: tmp = t_1 elif (x * y) <= 3.7e-267: tmp = 2.0 * (z * t) elif (x * y) <= 1.22e+89: tmp = 2.0 * (-c * (a * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2.6e+48) tmp = t_1; elseif (Float64(x * y) <= 3.7e-267) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 1.22e+89) tmp = Float64(2.0 * Float64(Float64(-c) * Float64(a * i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2.6e+48) tmp = t_1; elseif ((x * y) <= 3.7e-267) tmp = 2.0 * (z * t); elseif ((x * y) <= 1.22e+89) tmp = 2.0 * (-c * (a * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e+48], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.7e-267], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.22e+89], N[(2.0 * N[((-c) * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.7 \cdot 10^{-267}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{+89}:\\
\;\;\;\;2 \cdot \left(\left(-c\right) \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.59999999999999995e48 or 1.22e89 < (*.f64 x y) Initial program 88.4%
Taylor expanded in x around inf 58.1%
if -2.59999999999999995e48 < (*.f64 x y) < 3.69999999999999986e-267Initial program 93.1%
Taylor expanded in z around inf 47.3%
if 3.69999999999999986e-267 < (*.f64 x y) < 1.22e89Initial program 87.2%
Taylor expanded in a around inf 40.0%
mul-1-neg40.0%
*-commutative40.0%
associate-*l*34.6%
Simplified34.6%
Final simplification48.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -2.05e+48)
t_1
(if (<= (* x y) 1.1e-234)
(* 2.0 (* z t))
(if (<= (* x y) 2e+110) (* 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.05e+48) {
tmp = t_1;
} else if ((x * y) <= 1.1e-234) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 2e+110) {
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 = (x * y) * 2.0d0
if ((x * y) <= (-2.05d+48)) then
tmp = t_1
else if ((x * y) <= 1.1d-234) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 2d+110) 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -2.05e+48) {
tmp = t_1;
} else if ((x * y) <= 1.1e-234) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 2e+110) {
tmp = 2.0 * ((a * c) * -i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -2.05e+48: tmp = t_1 elif (x * y) <= 1.1e-234: tmp = 2.0 * (z * t) elif (x * y) <= 2e+110: 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(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -2.05e+48) tmp = t_1; elseif (Float64(x * y) <= 1.1e-234) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 2e+110) tmp = Float64(2.0 * Float64(Float64(a * c) * Float64(-i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -2.05e+48) tmp = t_1; elseif ((x * y) <= 1.1e-234) tmp = 2.0 * (z * t); elseif ((x * y) <= 2e+110) 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[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.05e+48], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.1e-234], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+110], N[(2.0 * N[(N[(a * c), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -2.05 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{-234}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+110}:\\
\;\;\;\;2 \cdot \left(\left(a \cdot c\right) \cdot \left(-i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0500000000000001e48 or 2e110 < (*.f64 x y) Initial program 87.8%
Taylor expanded in x around inf 60.0%
if -2.0500000000000001e48 < (*.f64 x y) < 1.1e-234Initial program 90.4%
Taylor expanded in z around inf 45.6%
if 1.1e-234 < (*.f64 x y) < 2e110Initial program 91.4%
Taylor expanded in a around inf 39.1%
mul-1-neg39.1%
*-commutative39.1%
associate-*l*33.5%
Simplified33.5%
Taylor expanded in c around 0 39.1%
*-commutative39.1%
associate-*r*33.5%
*-commutative33.5%
associate-*l*36.3%
Simplified36.3%
Final simplification48.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= (* x y) -1.05e+47)
t_1
(if (<= (* x y) 6.8e-249)
(* 2.0 (* z t))
(if (<= (* x y) 1.3e+117) (* (- 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.05e+47) {
tmp = t_1;
} else if ((x * y) <= 6.8e-249) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1.3e+117) {
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 = (x * y) * 2.0d0
if ((x * y) <= (-1.05d+47)) then
tmp = t_1
else if ((x * y) <= 6.8d-249) then
tmp = 2.0d0 * (z * t)
else if ((x * y) <= 1.3d+117) 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 = (x * y) * 2.0;
double tmp;
if ((x * y) <= -1.05e+47) {
tmp = t_1;
} else if ((x * y) <= 6.8e-249) {
tmp = 2.0 * (z * t);
} else if ((x * y) <= 1.3e+117) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if (x * y) <= -1.05e+47: tmp = t_1 elif (x * y) <= 6.8e-249: tmp = 2.0 * (z * t) elif (x * y) <= 1.3e+117: 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(Float64(x * y) * 2.0) tmp = 0.0 if (Float64(x * y) <= -1.05e+47) tmp = t_1; elseif (Float64(x * y) <= 6.8e-249) tmp = Float64(2.0 * Float64(z * t)); elseif (Float64(x * y) <= 1.3e+117) tmp = Float64(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 = (x * y) * 2.0; tmp = 0.0; if ((x * y) <= -1.05e+47) tmp = t_1; elseif ((x * y) <= 6.8e-249) tmp = 2.0 * (z * t); elseif ((x * y) <= 1.3e+117) 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[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+47], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.8e-249], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.3e+117], N[((-2.0) * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{-249}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{+117}:\\
\;\;\;\;\left(-2\right) \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05e47 or 1.3e117 < (*.f64 x y) Initial program 87.8%
Taylor expanded in x around inf 60.0%
if -1.05e47 < (*.f64 x y) < 6.7999999999999996e-249Initial program 93.1%
Taylor expanded in z around inf 47.3%
if 6.7999999999999996e-249 < (*.f64 x y) < 1.3e117Initial program 88.1%
Taylor expanded in a around inf 38.7%
mul-1-neg38.7%
distribute-rgt-neg-in38.7%
*-commutative38.7%
distribute-rgt-neg-in38.7%
Simplified38.7%
Final simplification49.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -4.6e-22) (not (<= c 0.034))) (* 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 <= -4.6e-22) || !(c <= 0.034)) {
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 <= (-4.6d-22)) .or. (.not. (c <= 0.034d0))) 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 <= -4.6e-22) || !(c <= 0.034)) {
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 <= -4.6e-22) or not (c <= 0.034): 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 <= -4.6e-22) || !(c <= 0.034)) 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 <= -4.6e-22) || ~((c <= 0.034))) 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, -4.6e-22], N[Not[LessEqual[c, 0.034]], $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 -4.6 \cdot 10^{-22} \lor \neg \left(c \leq 0.034\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 < -4.5999999999999996e-22 or 0.034000000000000002 < c Initial program 82.4%
Taylor expanded in x around 0 83.7%
if -4.5999999999999996e-22 < c < 0.034000000000000002Initial program 99.1%
Taylor expanded in c around 0 84.7%
Final simplification84.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -0.0026) (not (<= c 3.15e+41))) (* 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 <= -0.0026) || !(c <= 3.15e+41)) {
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 <= (-0.0026d0)) .or. (.not. (c <= 3.15d+41))) 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 <= -0.0026) || !(c <= 3.15e+41)) {
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 <= -0.0026) or not (c <= 3.15e+41): 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 <= -0.0026) || !(c <= 3.15e+41)) 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 <= -0.0026) || ~((c <= 3.15e+41))) 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, -0.0026], N[Not[LessEqual[c, 3.15e+41]], $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 -0.0026 \lor \neg \left(c \leq 3.15 \cdot 10^{+41}\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 < -0.0025999999999999999 or 3.1499999999999999e41 < c Initial program 80.3%
Taylor expanded in x around 0 84.7%
if -0.0025999999999999999 < c < 3.1499999999999999e41Initial program 99.2%
Taylor expanded in a around inf 97.0%
*-commutative97.0%
Simplified97.0%
Final simplification90.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -6.1e-18) (not (<= c 2.4e+45))) (* 2.0 (* (* (+ a (* b c)) i) (- c))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.1e-18) || !(c <= 2.4e+45)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-6.1d-18)) .or. (.not. (c <= 2.4d+45))) then
tmp = 2.0d0 * (((a + (b * c)) * i) * -c)
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -6.1e-18) || !(c <= 2.4e+45)) {
tmp = 2.0 * (((a + (b * c)) * i) * -c);
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -6.1e-18) or not (c <= 2.4e+45): tmp = 2.0 * (((a + (b * c)) * i) * -c) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -6.1e-18) || !(c <= 2.4e+45)) tmp = Float64(2.0 * Float64(Float64(Float64(a + Float64(b * c)) * i) * Float64(-c))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c <= -6.1e-18) || ~((c <= 2.4e+45))) tmp = 2.0 * (((a + (b * c)) * i) * -c); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -6.1e-18], N[Not[LessEqual[c, 2.4e+45]], $MachinePrecision]], N[(2.0 * N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision] * (-c)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.1 \cdot 10^{-18} \lor \neg \left(c \leq 2.4 \cdot 10^{+45}\right):\\
\;\;\;\;2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -6.0999999999999999e-18 or 2.39999999999999989e45 < c Initial program 81.0%
Taylor expanded in i around inf 77.2%
if -6.0999999999999999e-18 < c < 2.39999999999999989e45Initial program 99.1%
Taylor expanded in c around 0 83.5%
Final simplification80.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -9.6e+46) (not (<= (* x y) 2.8e-102))) (* (* x y) 2.0) (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -9.6e+46) || !((x * y) <= 2.8e-102)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-9.6d+46)) .or. (.not. ((x * y) <= 2.8d-102))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -9.6e+46) || !((x * y) <= 2.8e-102)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -9.6e+46) or not ((x * y) <= 2.8e-102): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -9.6e+46) || !(Float64(x * y) <= 2.8e-102)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -9.6e+46) || ~(((x * y) <= 2.8e-102))) tmp = (x * y) * 2.0; else tmp = 2.0 * (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9.6e+46], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.8e-102]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.6 \cdot 10^{+46} \lor \neg \left(x \cdot y \leq 2.8 \cdot 10^{-102}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.60000000000000034e46 or 2.80000000000000013e-102 < (*.f64 x y) Initial program 88.8%
Taylor expanded in x around inf 47.3%
if -9.60000000000000034e46 < (*.f64 x y) < 2.80000000000000013e-102Initial program 90.9%
Taylor expanded in z around inf 43.1%
Final simplification45.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.9e+142) (not (<= i 3.5e+136))) (* (- 2.0) (* a (* c i))) (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.9e+142) || !(i <= 3.5e+136)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((i <= (-2.9d+142)) .or. (.not. (i <= 3.5d+136))) then
tmp = -2.0d0 * (a * (c * i))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.9e+142) || !(i <= 3.5e+136)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -2.9e+142) or not (i <= 3.5e+136): tmp = -2.0 * (a * (c * i)) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.9e+142) || !(i <= 3.5e+136)) tmp = Float64(Float64(-2.0) * Float64(a * Float64(c * i))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((i <= -2.9e+142) || ~((i <= 3.5e+136))) tmp = -2.0 * (a * (c * i)); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.9e+142], N[Not[LessEqual[i, 3.5e+136]], $MachinePrecision]], N[((-2.0) * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.9 \cdot 10^{+142} \lor \neg \left(i \leq 3.5 \cdot 10^{+136}\right):\\
\;\;\;\;\left(-2\right) \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if i < -2.90000000000000013e142 or 3.50000000000000001e136 < i Initial program 91.6%
Taylor expanded in a around inf 55.0%
mul-1-neg55.0%
distribute-rgt-neg-in55.0%
*-commutative55.0%
distribute-rgt-neg-in55.0%
Simplified55.0%
if -2.90000000000000013e142 < i < 3.50000000000000001e136Initial program 89.1%
Taylor expanded in c around 0 65.5%
Final simplification63.1%
(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.7%
Taylor expanded in z around inf 27.4%
Final simplification27.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2023340
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))