
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (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 * (c * (t_1 * i));
}
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 * (c * (t_1 * i));
}
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 * (c * (t_1 * i)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(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(c * Float64(t_1 * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * c); t_2 = (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 * (c * (t_1 * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(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[(c * N[(t$95$1 * i), $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}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.8%
fma-def94.8%
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 x around 0 53.3%
Taylor expanded in t around 0 73.4%
Final simplification96.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+269)))
(* -2.0 (* c (* t_1 i)))
(* (- (+ (* x y) (* z t)) t_2) 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 <= -((double) INFINITY)) || !(t_2 <= 4e+269)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 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 = (c * t_1) * i;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 4e+269)) {
tmp = -2.0 * (c * (t_1 * i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 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 <= -math.inf) or not (t_2 <= 4e+269): tmp = -2.0 * (c * (t_1 * i)) else: tmp = (((x * y) + (z * t)) - t_2) * 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 <= Float64(-Inf)) || !(t_2 <= 4e+269)) tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 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 <= -Inf) || ~((t_2 <= 4e+269))) tmp = -2.0 * (c * (t_1 * i)); else tmp = (((x * y) + (z * t)) - t_2) * 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[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+269]], $MachinePrecision]], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $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 -\infty \lor \neg \left(t\_2 \leq 4 \cdot 10^{+269}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 4.0000000000000002e269 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 72.2%
Taylor expanded in x around 0 90.1%
Taylor expanded in t around 0 93.4%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000002e269Initial program 98.6%
Final simplification96.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (* 2.0 (- (* x y) t_1))))
(if (<= c -2.05e-42)
t_2
(if (<= c 5.5e-75)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(if (or (<= c 1.36e+29) (not (<= c 8.2e+71)))
(* 2.0 (- (* z t) 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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -2.05e-42) {
tmp = t_2;
} else if (c <= 5.5e-75) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else if ((c <= 1.36e+29) || !(c <= 8.2e+71)) {
tmp = 2.0 * ((z * t) - 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 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((x * y) - t_1)
if (c <= (-2.05d-42)) then
tmp = t_2
else if (c <= 5.5d-75) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else if ((c <= 1.36d+29) .or. (.not. (c <= 8.2d+71))) then
tmp = 2.0d0 * ((z * t) - 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 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if (c <= -2.05e-42) {
tmp = t_2;
} else if (c <= 5.5e-75) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else if ((c <= 1.36e+29) || !(c <= 8.2e+71)) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((x * y) - t_1) tmp = 0 if c <= -2.05e-42: tmp = t_2 elif c <= 5.5e-75: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) elif (c <= 1.36e+29) or not (c <= 8.2e+71): tmp = 2.0 * ((z * t) - t_1) else: tmp = t_2 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(2.0 * Float64(Float64(x * y) - t_1)) tmp = 0.0 if (c <= -2.05e-42) tmp = t_2; elseif (c <= 5.5e-75) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); elseif ((c <= 1.36e+29) || !(c <= 8.2e+71)) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = t_2; 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 = 2.0 * ((x * y) - t_1); tmp = 0.0; if (c <= -2.05e-42) tmp = t_2; elseif (c <= 5.5e-75) tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))); elseif ((c <= 1.36e+29) || ~((c <= 8.2e+71))) tmp = 2.0 * ((z * t) - 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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.05e-42], t$95$2, If[LessEqual[c, 5.5e-75], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c, 1.36e+29], N[Not[LessEqual[c, 8.2e+71]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{if}\;c \leq -2.05 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 5.5 \cdot 10^{-75}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 1.36 \cdot 10^{+29} \lor \neg \left(c \leq 8.2 \cdot 10^{+71}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -2.0500000000000001e-42 or 1.36e29 < c < 8.2000000000000004e71Initial program 77.4%
Taylor expanded in z around 0 87.1%
if -2.0500000000000001e-42 < c < 5.50000000000000026e-75Initial program 99.0%
Taylor expanded in a around inf 96.3%
*-commutative96.3%
Simplified96.3%
if 5.50000000000000026e-75 < c < 1.36e29 or 8.2000000000000004e71 < c Initial program 86.1%
Taylor expanded in x around 0 93.3%
Final simplification92.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
(if (<= c -7.8e+23)
t_1
(if (<= c -1.05e-121)
(* 2.0 (- (* x y) (* c (* a i))))
(if (<= c 3.5e-121) (* (+ (* x y) (* z t)) 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) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -7.8e+23) {
tmp = t_1;
} else if (c <= -1.05e-121) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 3.5e-121) {
tmp = ((x * y) + (z * t)) * 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) - (c * ((a + (b * c)) * i)))
if (c <= (-7.8d+23)) then
tmp = t_1
else if (c <= (-1.05d-121)) then
tmp = 2.0d0 * ((x * y) - (c * (a * i)))
else if (c <= 3.5d-121) then
tmp = ((x * y) + (z * t)) * 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) - (c * ((a + (b * c)) * i)));
double tmp;
if (c <= -7.8e+23) {
tmp = t_1;
} else if (c <= -1.05e-121) {
tmp = 2.0 * ((x * y) - (c * (a * i)));
} else if (c <= 3.5e-121) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) tmp = 0 if c <= -7.8e+23: tmp = t_1 elif c <= -1.05e-121: tmp = 2.0 * ((x * y) - (c * (a * i))) elif c <= 3.5e-121: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))) tmp = 0.0 if (c <= -7.8e+23) tmp = t_1; elseif (c <= -1.05e-121) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i)))); elseif (c <= 3.5e-121) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 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) - (c * ((a + (b * c)) * i))); tmp = 0.0; if (c <= -7.8e+23) tmp = t_1; elseif (c <= -1.05e-121) tmp = 2.0 * ((x * y) - (c * (a * i))); elseif (c <= 3.5e-121) tmp = ((x * y) + (z * t)) * 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[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7.8e+23], t$95$1, If[LessEqual[c, -1.05e-121], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.5e-121], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -7.8 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -1.05 \cdot 10^{-121}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 3.5 \cdot 10^{-121}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -7.8000000000000001e23 or 3.49999999999999993e-121 < c Initial program 82.5%
Taylor expanded in x around 0 85.9%
if -7.8000000000000001e23 < c < -1.0499999999999999e-121Initial program 95.8%
Taylor expanded in a around inf 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 76.9%
associate-*r*80.9%
*-commutative80.9%
associate-*r*77.2%
*-commutative77.2%
Simplified77.2%
if -1.0499999999999999e-121 < c < 3.49999999999999993e-121Initial program 98.8%
Taylor expanded in c around 0 84.7%
Final simplification84.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (or (<= (* x y) -0.55) (not (<= (* x y) 3e+93)))
(* 2.0 (- (* x y) t_1))
(* 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 (((x * y) <= -0.55) || !((x * y) <= 3e+93)) {
tmp = 2.0 * ((x * y) - t_1);
} 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 (((x * y) <= (-0.55d0)) .or. (.not. ((x * y) <= 3d+93))) then
tmp = 2.0d0 * ((x * y) - t_1)
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 (((x * y) <= -0.55) || !((x * y) <= 3e+93)) {
tmp = 2.0 * ((x * y) - t_1);
} 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 ((x * y) <= -0.55) or not ((x * y) <= 3e+93): tmp = 2.0 * ((x * y) - t_1) 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 ((Float64(x * y) <= -0.55) || !(Float64(x * y) <= 3e+93)) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); 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 (((x * y) <= -0.55) || ~(((x * y) <= 3e+93))) tmp = 2.0 * ((x * y) - t_1); 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[Or[LessEqual[N[(x * y), $MachinePrecision], -0.55], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3e+93]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;x \cdot y \leq -0.55 \lor \neg \left(x \cdot y \leq 3 \cdot 10^{+93}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -0.55000000000000004 or 2.99999999999999978e93 < (*.f64 x y) Initial program 85.1%
Taylor expanded in z around 0 80.7%
if -0.55000000000000004 < (*.f64 x y) < 2.99999999999999978e93Initial program 92.4%
Taylor expanded in x around 0 88.2%
Final simplification84.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* c (* (+ a (* b c)) i)))))
(if (<= c -8.6e-44)
t_1
(if (<= c 5.5e-121)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 1.95e+29) (* 2.0 (- (* z t) (* 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 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8.6e-44) {
tmp = t_1;
} else if (c <= 5.5e-121) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 1.95e+29) {
tmp = 2.0 * ((z * t) - (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 = (-2.0d0) * (c * ((a + (b * c)) * i))
if (c <= (-8.6d-44)) then
tmp = t_1
else if (c <= 5.5d-121) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 1.95d+29) then
tmp = 2.0d0 * ((z * t) - (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 = -2.0 * (c * ((a + (b * c)) * i));
double tmp;
if (c <= -8.6e-44) {
tmp = t_1;
} else if (c <= 5.5e-121) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 1.95e+29) {
tmp = 2.0 * ((z * t) - (c * (a * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (c * ((a + (b * c)) * i)) tmp = 0 if c <= -8.6e-44: tmp = t_1 elif c <= 5.5e-121: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 1.95e+29: tmp = 2.0 * ((z * t) - (c * (a * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i))) tmp = 0.0 if (c <= -8.6e-44) tmp = t_1; elseif (c <= 5.5e-121) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 1.95e+29) tmp = Float64(2.0 * Float64(Float64(z * t) - 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 = -2.0 * (c * ((a + (b * c)) * i)); tmp = 0.0; if (c <= -8.6e-44) tmp = t_1; elseif (c <= 5.5e-121) tmp = ((x * y) + (z * t)) * 2.0; elseif (c <= 1.95e+29) tmp = 2.0 * ((z * t) - (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[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.6e-44], t$95$1, If[LessEqual[c, 5.5e-121], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 1.95e+29], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -8.6 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 5.5 \cdot 10^{-121}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 1.95 \cdot 10^{+29}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -8.60000000000000027e-44 or 1.94999999999999984e29 < c Initial program 78.4%
Taylor expanded in x around 0 82.3%
Taylor expanded in t around 0 80.9%
if -8.60000000000000027e-44 < c < 5.50000000000000031e-121Initial program 98.9%
Taylor expanded in c around 0 80.2%
if 5.50000000000000031e-121 < c < 1.94999999999999984e29Initial program 95.2%
Taylor expanded in a around inf 76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in x around 0 69.9%
associate-*r*69.1%
*-commutative69.1%
associate-*r*73.3%
*-commutative73.3%
Simplified73.3%
Final simplification79.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= i -2.2e+89)
(* -2.0 (* a (* c i)))
(if (or (<= i 6.8e+149) (not (<= i 1.36e+257)))
(* (+ (* x y) (* z t)) 2.0)
(* -2.0 (* c (* a i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -2.2e+89) {
tmp = -2.0 * (a * (c * i));
} else if ((i <= 6.8e+149) || !(i <= 1.36e+257)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (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 (i <= (-2.2d+89)) then
tmp = (-2.0d0) * (a * (c * i))
else if ((i <= 6.8d+149) .or. (.not. (i <= 1.36d+257))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (-2.0d0) * (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 (i <= -2.2e+89) {
tmp = -2.0 * (a * (c * i));
} else if ((i <= 6.8e+149) || !(i <= 1.36e+257)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -2.2e+89: tmp = -2.0 * (a * (c * i)) elif (i <= 6.8e+149) or not (i <= 1.36e+257): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = -2.0 * (c * (a * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -2.2e+89) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif ((i <= 6.8e+149) || !(i <= 1.36e+257)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(-2.0 * 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 (i <= -2.2e+89) tmp = -2.0 * (a * (c * i)); elseif ((i <= 6.8e+149) || ~((i <= 1.36e+257))) tmp = ((x * y) + (z * t)) * 2.0; else tmp = -2.0 * (c * (a * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -2.2e+89], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[i, 6.8e+149], N[Not[LessEqual[i, 1.36e+257]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.2 \cdot 10^{+89}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;i \leq 6.8 \cdot 10^{+149} \lor \neg \left(i \leq 1.36 \cdot 10^{+257}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if i < -2.2e89Initial program 88.2%
Taylor expanded in a around inf 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 68.7%
Taylor expanded in t around 0 64.3%
if -2.2e89 < i < 6.7999999999999997e149 or 1.35999999999999993e257 < i Initial program 89.8%
Taylor expanded in c around 0 60.4%
if 6.7999999999999997e149 < i < 1.35999999999999993e257Initial program 86.2%
Taylor expanded in a around inf 54.8%
*-commutative54.8%
Simplified54.8%
Taylor expanded in x around 0 55.8%
Taylor expanded in t around 0 50.6%
associate-*r*50.4%
*-commutative50.4%
associate-*r*51.0%
*-commutative51.0%
Simplified51.0%
Final simplification60.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -2.0 (* a (* c i)))))
(if (<= i -2.45)
t_1
(if (<= i -2.75e-229)
(* (* x y) 2.0)
(if (<= i 6.2e-43) (* 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 = -2.0 * (a * (c * i));
double tmp;
if (i <= -2.45) {
tmp = t_1;
} else if (i <= -2.75e-229) {
tmp = (x * y) * 2.0;
} else if (i <= 6.2e-43) {
tmp = 2.0 * (z * t);
} 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) * (a * (c * i))
if (i <= (-2.45d0)) then
tmp = t_1
else if (i <= (-2.75d-229)) then
tmp = (x * y) * 2.0d0
else if (i <= 6.2d-43) then
tmp = 2.0d0 * (z * t)
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 * (a * (c * i));
double tmp;
if (i <= -2.45) {
tmp = t_1;
} else if (i <= -2.75e-229) {
tmp = (x * y) * 2.0;
} else if (i <= 6.2e-43) {
tmp = 2.0 * (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -2.0 * (a * (c * i)) tmp = 0 if i <= -2.45: tmp = t_1 elif i <= -2.75e-229: tmp = (x * y) * 2.0 elif i <= 6.2e-43: tmp = 2.0 * (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-2.0 * Float64(a * Float64(c * i))) tmp = 0.0 if (i <= -2.45) tmp = t_1; elseif (i <= -2.75e-229) tmp = Float64(Float64(x * y) * 2.0); elseif (i <= 6.2e-43) tmp = Float64(2.0 * Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -2.0 * (a * (c * i)); tmp = 0.0; if (i <= -2.45) tmp = t_1; elseif (i <= -2.75e-229) tmp = (x * y) * 2.0; elseif (i <= 6.2e-43) tmp = 2.0 * (z * t); 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.45], t$95$1, If[LessEqual[i, -2.75e-229], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[i, 6.2e-43], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;i \leq -2.45:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -2.75 \cdot 10^{-229}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{elif}\;i \leq 6.2 \cdot 10^{-43}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -2.4500000000000002 or 6.1999999999999999e-43 < i Initial program 91.3%
Taylor expanded in a around inf 64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 56.1%
Taylor expanded in t around 0 43.4%
if -2.4500000000000002 < i < -2.7500000000000001e-229Initial program 86.4%
Taylor expanded in x around inf 46.3%
if -2.7500000000000001e-229 < i < 6.1999999999999999e-43Initial program 86.9%
Taylor expanded in z around inf 47.0%
Final simplification44.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.25e-42) (not (<= c 7.6e-41))) (* -2.0 (* 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-42) || !(c <= 7.6e-41)) {
tmp = -2.0 * (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-42)) .or. (.not. (c <= 7.6d-41))) then
tmp = (-2.0d0) * (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-42) || !(c <= 7.6e-41)) {
tmp = -2.0 * (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-42) or not (c <= 7.6e-41): tmp = -2.0 * (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-42) || !(c <= 7.6e-41)) tmp = Float64(-2.0 * 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-42) || ~((c <= 7.6e-41))) tmp = -2.0 * (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-42], N[Not[LessEqual[c, 7.6e-41]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * 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.25 \cdot 10^{-42} \lor \neg \left(c \leq 7.6 \cdot 10^{-41}\right):\\
\;\;\;\;-2 \cdot \left(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.25000000000000001e-42 or 7.59999999999999958e-41 < c Initial program 81.0%
Taylor expanded in x around 0 84.0%
Taylor expanded in t around 0 77.9%
if -1.25000000000000001e-42 < c < 7.59999999999999958e-41Initial program 99.0%
Taylor expanded in c around 0 77.1%
Final simplification77.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -145.0) (not (<= (* x y) 3.4e+93))) (* (* 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) <= -145.0) || !((x * y) <= 3.4e+93)) {
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) <= (-145.0d0)) .or. (.not. ((x * y) <= 3.4d+93))) 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) <= -145.0) || !((x * y) <= 3.4e+93)) {
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) <= -145.0) or not ((x * y) <= 3.4e+93): 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) <= -145.0) || !(Float64(x * y) <= 3.4e+93)) 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) <= -145.0) || ~(((x * y) <= 3.4e+93))) 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], -145.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.4e+93]], $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 -145 \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+93}\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) < -145 or 3.4e93 < (*.f64 x y) Initial program 85.1%
Taylor expanded in x around inf 52.9%
if -145 < (*.f64 x y) < 3.4e93Initial program 92.4%
Taylor expanded in z around inf 37.1%
Final simplification44.0%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (z * t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 89.2%
Taylor expanded in z around inf 28.7%
Final simplification28.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024027
(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))))