
(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))))
(* (* c (* t_1 i)) (- 2.0)))))
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 = (c * (t_1 * i)) * -2.0;
}
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(Float64(c * Float64(t_1 * i)) * Float64(-2.0)); 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[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $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}:\\
\;\;\;\;\left(c \cdot \left(t_1 \cdot i\right)\right) \cdot \left(-2\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.3%
fma-def93.3%
associate-*l*98.0%
Simplified98.0%
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 63.7%
Final simplification96.5%
(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))))
(* (* c (* t_1 i)) (- 2.0)))))
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 = (c * (t_1 * i)) * -2.0;
}
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 = (c * (t_1 * i)) * -2.0;
}
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 = (c * (t_1 * i)) * -2.0 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(Float64(c * Float64(t_1 * i)) * Float64(-2.0)); 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 = (c * (t_1 * i)) * -2.0; 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[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $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}:\\
\;\;\;\;\left(c \cdot \left(t_1 \cdot i\right)\right) \cdot \left(-2\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.3%
fma-def93.3%
associate-*l*98.0%
Simplified98.0%
fma-def98.0%
+-commutative98.0%
Applied egg-rr98.0%
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 63.7%
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)))
(if (<= t_2 4e+239)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* (* c (* t_1 i)) (- 2.0)))))
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 tmp;
if (t_2 <= 4e+239) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = (c * (t_1 * i)) * -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) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if (t_2 <= 4d+239) then
tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
else
tmp = (c * (t_1 * i)) * -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 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= 4e+239) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = (c * (t_1 * i)) * -2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= 4e+239: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = (c * (t_1 * i)) * -2.0 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) tmp = 0.0 if (t_2 <= 4e+239) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(Float64(c * Float64(t_1 * i)) * Float64(-2.0)); 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; tmp = 0.0; if (t_2 <= 4e+239) tmp = (((x * y) + (z * t)) - t_2) * 2.0; else tmp = (c * (t_1 * i)) * -2.0; 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]}, If[LessEqual[t$95$2, 4e+239], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq 4 \cdot 10^{+239}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(t_1 \cdot i\right)\right) \cdot \left(-2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 3.99999999999999996e239Initial program 94.4%
if 3.99999999999999996e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 64.0%
Taylor expanded in i around inf 90.8%
Final simplification93.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* z t) -5e+110) (not (<= (* z t) 2e+48)))
(* 2.0 (- (* z t) t_1))
(* 2.0 (- (* x y) 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 (((z * t) <= -5e+110) || !((z * t) <= 2e+48)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - 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 (((z * t) <= (-5d+110)) .or. (.not. ((z * t) <= 2d+48))) then
tmp = 2.0d0 * ((z * t) - t_1)
else
tmp = 2.0d0 * ((x * y) - 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 (((z * t) <= -5e+110) || !((z * t) <= 2e+48)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if ((z * t) <= -5e+110) or not ((z * t) <= 2e+48): tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * ((x * y) - 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 ((Float64(z * t) <= -5e+110) || !(Float64(z * t) <= 2e+48)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = Float64(2.0 * Float64(Float64(x * y) - 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 (((z * t) <= -5e+110) || ~(((z * t) <= 2e+48))) tmp = 2.0 * ((z * t) - t_1); else tmp = 2.0 * ((x * y) - 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[Or[LessEqual[N[(z * t), $MachinePrecision], -5e+110], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+48]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $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}\;z \cdot t \leq -5 \cdot 10^{+110} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+48}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -4.99999999999999978e110 or 2.00000000000000009e48 < (*.f64 z t) Initial program 89.9%
Taylor expanded in x around 0 83.4%
if -4.99999999999999978e110 < (*.f64 z t) < 2.00000000000000009e48Initial program 89.0%
Taylor expanded in z around 0 83.9%
Final simplification83.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5.4e-61) (not (<= (* x y) 2.2e+45))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* z t) (* c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5.4e-61) || !((x * y) <= 2.2e+45)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-5.4d-61)) .or. (.not. ((x * y) <= 2.2d+45))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (c * (a * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5.4e-61) || !((x * y) <= 2.2e+45)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (c * (a * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5.4e-61) or not ((x * y) <= 2.2e+45): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (c * (a * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5.4e-61) || !(Float64(x * y) <= 2.2e+45)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(a * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -5.4e-61) || ~(((x * y) <= 2.2e+45))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = 2.0 * ((z * t) - (c * (a * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5.4e-61], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.2e+45]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.4 \cdot 10^{-61} \lor \neg \left(x \cdot y \leq 2.2 \cdot 10^{+45}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.39999999999999987e-61 or 2.2e45 < (*.f64 x y) Initial program 88.0%
Taylor expanded in c around 0 66.5%
if -5.39999999999999987e-61 < (*.f64 x y) < 2.2e45Initial program 90.8%
Taylor expanded in a around inf 73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in x around 0 69.5%
*-commutative69.5%
associate-*r*65.6%
Simplified65.6%
Final simplification66.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.25e-40) (not (<= c 5.6e-63))) (* 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 <= -1.25e-40) || !(c <= 5.6e-63)) {
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 <= (-1.25d-40)) .or. (.not. (c <= 5.6d-63))) 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 <= -1.25e-40) || !(c <= 5.6e-63)) {
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 <= -1.25e-40) or not (c <= 5.6e-63): 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 <= -1.25e-40) || !(c <= 5.6e-63)) 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 <= -1.25e-40) || ~((c <= 5.6e-63))) 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, -1.25e-40], N[Not[LessEqual[c, 5.6e-63]], $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 -1.25 \cdot 10^{-40} \lor \neg \left(c \leq 5.6 \cdot 10^{-63}\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 < -1.24999999999999991e-40 or 5.6000000000000005e-63 < c Initial program 82.4%
Taylor expanded in x around 0 79.9%
if -1.24999999999999991e-40 < c < 5.6000000000000005e-63Initial program 99.0%
Taylor expanded in c around 0 82.6%
Final simplification81.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.1e+53) (not (<= c 7e-22))) (* 2.0 (- (* x y) (* 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 <= -1.1e+53) || !(c <= 7e-22)) {
tmp = 2.0 * ((x * y) - (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 <= (-1.1d+53)) .or. (.not. (c <= 7d-22))) then
tmp = 2.0d0 * ((x * y) - (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 <= -1.1e+53) || !(c <= 7e-22)) {
tmp = 2.0 * ((x * y) - (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 <= -1.1e+53) or not (c <= 7e-22): tmp = 2.0 * ((x * y) - (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 <= -1.1e+53) || !(c <= 7e-22)) tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -1.1e+53) || ~((c <= 7e-22))) tmp = 2.0 * ((x * y) - (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, -1.1e+53], N[Not[LessEqual[c, 7e-22]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $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 -1.1 \cdot 10^{+53} \lor \neg \left(c \leq 7 \cdot 10^{-22}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - 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 < -1.09999999999999999e53 or 7.00000000000000011e-22 < c Initial program 78.8%
Taylor expanded in z around 0 84.6%
if -1.09999999999999999e53 < c < 7.00000000000000011e-22Initial program 99.2%
Taylor expanded in a around inf 96.2%
*-commutative96.2%
Simplified96.2%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -1e+100)
(* 2.0 (+ (* z t) (* a (* c i))))
(if (<= (* z t) 5e+58)
(* 2.0 (- (* x y) (* c (* a 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 ((z * t) <= -1e+100) {
tmp = 2.0 * ((z * t) + (a * (c * i)));
} else if ((z * t) <= 5e+58) {
tmp = 2.0 * ((x * y) - (c * (a * 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 ((z * t) <= (-1d+100)) then
tmp = 2.0d0 * ((z * t) + (a * (c * i)))
else if ((z * t) <= 5d+58) then
tmp = 2.0d0 * ((x * y) - (c * (a * 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 ((z * t) <= -1e+100) {
tmp = 2.0 * ((z * t) + (a * (c * i)));
} else if ((z * t) <= 5e+58) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -1e+100: tmp = 2.0 * ((z * t) + (a * (c * i))) elif (z * t) <= 5e+58: tmp = 2.0 * ((x * y) - (c * (a * 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 (Float64(z * t) <= -1e+100) tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(a * Float64(c * i)))); elseif (Float64(z * t) <= 5e+58) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * 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 ((z * t) <= -1e+100) tmp = 2.0 * ((z * t) + (a * (c * i))); elseif ((z * t) <= 5e+58) tmp = 2.0 * ((x * y) - (c * (a * i))); else tmp = ((x * y) + (z * t)) * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+100], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+58], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * 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}\;z \cdot t \leq -1 \cdot 10^{+100}:\\
\;\;\;\;2 \cdot \left(z \cdot t + a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+58}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 z t) < -1.00000000000000002e100Initial program 89.5%
Taylor expanded in a around inf 79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in x around 0 72.8%
*-commutative72.8%
associate-*r*68.9%
Simplified68.9%
*-commutative68.9%
fma-neg68.9%
Applied egg-rr68.9%
fma-udef68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
*-commutative68.9%
associate-*r*72.8%
add-sqr-sqrt45.0%
sqrt-unprod69.0%
sqr-neg69.0%
sqrt-unprod26.1%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
if -1.00000000000000002e100 < (*.f64 z t) < 4.99999999999999986e58Initial program 89.0%
Taylor expanded in a around inf 69.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in z around 0 67.7%
*-commutative67.7%
associate-*r*61.5%
Simplified61.5%
if 4.99999999999999986e58 < (*.f64 z t) Initial program 90.0%
Taylor expanded in c around 0 75.8%
Final simplification65.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.9e+30) (not (<= c 1.25))) (* (* 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 <= -1.9e+30) || !(c <= 1.25)) {
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 <= (-1.9d+30)) .or. (.not. (c <= 1.25d0))) 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 <= -1.9e+30) || !(c <= 1.25)) {
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 <= -1.9e+30) or not (c <= 1.25): 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 <= -1.9e+30) || !(c <= 1.25)) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * Float64(-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 <= -1.9e+30) || ~((c <= 1.25))) 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, -1.9e+30], N[Not[LessEqual[c, 1.25]], $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 -1.9 \cdot 10^{+30} \lor \neg \left(c \leq 1.25\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if c < -1.9000000000000001e30 or 1.25 < c Initial program 79.2%
Taylor expanded in i around inf 75.8%
if -1.9000000000000001e30 < c < 1.25Initial program 98.4%
Taylor expanded in c around 0 79.0%
Final simplification77.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t))))
(if (<= z -4.1e+96)
t_1
(if (<= z -3e-220)
(* (* c i) (* a -2.0))
(if (<= z 3.95e-143) (* (* 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 (z <= -4.1e+96) {
tmp = t_1;
} else if (z <= -3e-220) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 3.95e-143) {
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 (z <= (-4.1d+96)) then
tmp = t_1
else if (z <= (-3d-220)) then
tmp = (c * i) * (a * (-2.0d0))
else if (z <= 3.95d-143) 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 (z <= -4.1e+96) {
tmp = t_1;
} else if (z <= -3e-220) {
tmp = (c * i) * (a * -2.0);
} else if (z <= 3.95e-143) {
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 z <= -4.1e+96: tmp = t_1 elif z <= -3e-220: tmp = (c * i) * (a * -2.0) elif z <= 3.95e-143: 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 (z <= -4.1e+96) tmp = t_1; elseif (z <= -3e-220) tmp = Float64(Float64(c * i) * Float64(a * -2.0)); elseif (z <= 3.95e-143) 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 (z <= -4.1e+96) tmp = t_1; elseif (z <= -3e-220) tmp = (c * i) * (a * -2.0); elseif (z <= 3.95e-143) 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[z, -4.1e+96], t$95$1, If[LessEqual[z, -3e-220], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.95e-143], 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}\;z \leq -4.1 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-220}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{elif}\;z \leq 3.95 \cdot 10^{-143}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.09999999999999998e96 or 3.95000000000000015e-143 < z Initial program 89.0%
Taylor expanded in z around inf 40.5%
if -4.09999999999999998e96 < z < -3.00000000000000017e-220Initial program 87.8%
Taylor expanded in a around inf 37.4%
mul-1-neg37.4%
distribute-rgt-neg-in37.4%
*-commutative37.4%
distribute-rgt-neg-in37.4%
Simplified37.4%
Taylor expanded in a around 0 37.4%
associate-*r*37.4%
*-commutative37.4%
Simplified37.4%
if -3.00000000000000017e-220 < z < 3.95000000000000015e-143Initial program 92.0%
Taylor expanded in x around inf 49.1%
Final simplification41.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.9e-61) (not (<= (* x y) 2.4e+163))) (* (* 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) <= -3.9e-61) || !((x * y) <= 2.4e+163)) {
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) <= (-3.9d-61)) .or. (.not. ((x * y) <= 2.4d+163))) 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) <= -3.9e-61) || !((x * y) <= 2.4e+163)) {
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) <= -3.9e-61) or not ((x * y) <= 2.4e+163): 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) <= -3.9e-61) || !(Float64(x * y) <= 2.4e+163)) 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) <= -3.9e-61) || ~(((x * y) <= 2.4e+163))) 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], -3.9e-61], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.4e+163]], $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 -3.9 \cdot 10^{-61} \lor \neg \left(x \cdot y \leq 2.4 \cdot 10^{+163}\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) < -3.90000000000000033e-61 or 2.3999999999999999e163 < (*.f64 x y) Initial program 86.2%
Taylor expanded in x around inf 52.0%
if -3.90000000000000033e-61 < (*.f64 x y) < 2.3999999999999999e163Initial program 92.0%
Taylor expanded in z around inf 35.1%
Final simplification43.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c -4.3e+105) (* 2.0 (* i (- (* a c)))) (if (<= c 3.6e+193) (* (+ (* x y) (* z t)) 2.0) (* (* c i) (* a -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.3e+105) {
tmp = 2.0 * (i * -(a * c));
} else if (c <= 3.6e+193) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * i) * (a * -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.3d+105)) then
tmp = 2.0d0 * (i * -(a * c))
else if (c <= 3.6d+193) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (c * i) * (a * (-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.3e+105) {
tmp = 2.0 * (i * -(a * c));
} else if (c <= 3.6e+193) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (c * i) * (a * -2.0);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -4.3e+105: tmp = 2.0 * (i * -(a * c)) elif c <= 3.6e+193: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (c * i) * (a * -2.0) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -4.3e+105) tmp = Float64(2.0 * Float64(i * Float64(-Float64(a * c)))); elseif (c <= 3.6e+193) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(c * i) * Float64(a * -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= -4.3e+105) tmp = 2.0 * (i * -(a * c)); elseif (c <= 3.6e+193) tmp = ((x * y) + (z * t)) * 2.0; else tmp = (c * i) * (a * -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -4.3e+105], N[(2.0 * N[(i * (-N[(a * c), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.6e+193], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.3 \cdot 10^{+105}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(-a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 3.6 \cdot 10^{+193}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\end{array}
\end{array}
if c < -4.3000000000000002e105Initial program 74.7%
fma-def74.7%
associate-*l*85.6%
Simplified85.6%
fma-def85.6%
+-commutative85.6%
Applied egg-rr85.6%
Taylor expanded in a around inf 27.1%
associate-*r*27.1%
neg-mul-127.1%
associate-*r*32.6%
*-commutative32.6%
*-commutative32.6%
distribute-rgt-neg-out32.6%
*-commutative32.6%
distribute-rgt-neg-in32.6%
Simplified32.6%
if -4.3000000000000002e105 < c < 3.6e193Initial program 92.2%
Taylor expanded in c around 0 65.2%
if 3.6e193 < c Initial program 84.3%
Taylor expanded in a around inf 55.8%
mul-1-neg55.8%
distribute-rgt-neg-in55.8%
*-commutative55.8%
distribute-rgt-neg-in55.8%
Simplified55.8%
Taylor expanded in a around 0 55.8%
associate-*r*55.8%
*-commutative55.8%
Simplified55.8%
Final simplification60.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.3%
Taylor expanded in z around inf 27.8%
Final simplification27.8%
(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 2024018
(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))))