
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) \cdot t_1 + t_0 \cdot t_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (fma 2.0 x2 (- x1)))))
(if (<= x1 -5e+153)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 5e+102)
(+
x1
(fma
3.0
(/ (- (* x1 (* x1 3.0)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(fma
x1
(* x1 (/ t_0 (/ (fma x1 x1 1.0) 3.0)))
(*
(fma x1 x1 1.0)
(+
x1
(+
(* x1 (* x1 -6.0))
(*
(/ t_0 (fma x1 x1 1.0))
(+
(* x1 (+ -6.0 (/ t_0 (/ (fma x1 x1 1.0) 2.0))))
(* (* x1 x1) 4.0)))))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(- (* x1 9.0) 3.0)
(*
(fma x1 x1 1.0)
(+ x1 (* 2.0 (* (- (* x2 4.0) 6.0) (* x1 x2))))))))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), fma(2.0, x2, -x1));
double tmp;
if (x1 <= -5e+153) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= 5e+102) {
tmp = x1 + fma(3.0, (((x1 * (x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, (x1 * (t_0 / (fma(x1, x1, 1.0) / 3.0))), (fma(x1, x1, 1.0) * (x1 + ((x1 * (x1 * -6.0)) + ((t_0 / fma(x1, x1, 1.0)) * ((x1 * (-6.0 + (t_0 / (fma(x1, x1, 1.0) / 2.0)))) + ((x1 * x1) * 4.0))))))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, ((x1 * 9.0) - 3.0), (fma(x1, x1, 1.0) * (x1 + (2.0 * (((x2 * 4.0) - 6.0) * (x1 * x2)))))));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), fma(2.0, x2, Float64(-x1))) tmp = 0.0 if (x1 <= -5e+153) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= 5e+102) tmp = Float64(x1 + fma(3.0, Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), fma(x1, Float64(x1 * Float64(t_0 / Float64(fma(x1, x1, 1.0) / 3.0))), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(Float64(x1 * Float64(x1 * -6.0)) + Float64(Float64(t_0 / fma(x1, x1, 1.0)) * Float64(Float64(x1 * Float64(-6.0 + Float64(t_0 / Float64(fma(x1, x1, 1.0) / 2.0)))) + Float64(Float64(x1 * x1) * 4.0))))))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(Float64(x1 * 9.0) - 3.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(2.0 * Float64(Float64(Float64(x2 * 4.0) - 6.0) * Float64(x1 * x2)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+153], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+102], N[(x1 + N[(3.0 * N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(N[(x1 * N[(x1 * -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(x1 * N[(-6.0 + N[(t$95$0 / N[(N[(x1 * x1 + 1.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(2.0 * N[(N[(N[(x2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, \mathsf{fma}\left(2, x2, -x1\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+153}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{x1 \cdot \left(x1 \cdot 3\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \mathsf{fma}\left(x1, x1 \cdot \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{3}}, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + \left(x1 \cdot \left(x1 \cdot -6\right) + \frac{t_0}{\mathsf{fma}\left(x1, x1, 1\right)} \cdot \left(x1 \cdot \left(-6 + \frac{t_0}{\frac{\mathsf{fma}\left(x1, x1, 1\right)}{2}}\right) + \left(x1 \cdot x1\right) \cdot 4\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9 - 3, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + 2 \cdot \left(\left(x2 \cdot 4 - 6\right) \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.00000000000000018e153Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x2 around 0 63.0%
*-commutative63.0%
unpow263.0%
Simplified63.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -5.00000000000000018e153 < x1 < 5e102Initial program 91.8%
Simplified99.7%
if 5e102 < x1 Initial program 17.4%
Simplified17.4%
Taylor expanded in x1 around 0 17.4%
Taylor expanded in x1 around inf 17.4%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ 1.0 (* x1 x1)))
(t_2 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -4e+156)
(+ x1 (* x1 (* x1 9.0)))
(if (<= x1 -2e+104)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) t_2))
(if (<= x1 6e+102)
(+
x1
(+
t_2
(+
x1
(+
(+
(*
t_1
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))))
(+
x1
(fma
3.0
(* x2 -2.0)
(fma
x1
(- (* x1 9.0) 3.0)
(*
(fma x1 x1 1.0)
(+ x1 (* 2.0 (* (- (* x2 4.0) 6.0) (* x1 x2)))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 1.0 + (x1 * x1);
double t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -4e+156) {
tmp = x1 + (x1 * (x1 * 9.0));
} else if (x1 <= -2e+104) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + t_2);
} else if (x1 <= 6e+102) {
tmp = x1 + (t_2 + (x1 + (((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))));
} else {
tmp = x1 + fma(3.0, (x2 * -2.0), fma(x1, ((x1 * 9.0) - 3.0), (fma(x1, x1, 1.0) * (x1 + (2.0 * (((x2 * 4.0) - 6.0) * (x1 * x2)))))));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(1.0 + Float64(x1 * x1)) t_2 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -4e+156) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); elseif (x1 <= -2e+104) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_2)); elseif (x1 <= 6e+102) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + fma(3.0, Float64(x2 * -2.0), fma(x1, Float64(Float64(x1 * 9.0) - 3.0), Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(2.0 * Float64(Float64(Float64(x2 * 4.0) - 6.0) * Float64(x1 * x2)))))))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -4e+156], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2e+104], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e+102], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(3.0 * N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(2.0 * N[(N[(N[(x2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 1 + x1 \cdot x1\\
t_2 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+156}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{elif}\;x1 \leq -2 \cdot 10^{+104}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_2\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + \left(\left(t_1 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + t_0 \cdot t_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, x2 \cdot -2, \mathsf{fma}\left(x1, x1 \cdot 9 - 3, \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + 2 \cdot \left(\left(x2 \cdot 4 - 6\right) \cdot \left(x1 \cdot x2\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -3.9999999999999999e156Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x2 around 0 63.0%
*-commutative63.0%
unpow263.0%
Simplified63.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -3.9999999999999999e156 < x1 < -2e104Initial program 6.7%
Taylor expanded in x1 around inf 93.3%
*-commutative93.3%
Simplified93.3%
if -2e104 < x1 < 5.9999999999999996e102Initial program 99.4%
if 5.9999999999999996e102 < x1 Initial program 17.4%
Simplified17.4%
Taylor expanded in x1 around 0 17.4%
Taylor expanded in x1 around inf 17.4%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ 1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (* x1 (* x1 9.0))))))
double code(double x1, double x2) {
double t_0 = 1.0 + (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (x1 * 9.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = 1.0 + (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (x1 * 9.0));
}
return tmp;
}
def code(x1, x2): t_0 = 1.0 + (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1))))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 * (x1 * 9.0)) return tmp
function code(x1, x2) t_0 = Float64(1.0 + Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 1.0 + (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1))))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 * (x1 * 9.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_0}\\
t_3 := x1 + \left(3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_0} + \left(x1 + \left(\left(t_0 \cdot \left(\left(t_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right)\right) + t_1 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x2 around 0 70.2%
*-commutative70.2%
unpow270.2%
Simplified70.2%
Taylor expanded in x1 around inf 83.7%
*-commutative83.7%
unpow283.7%
associate-*r*83.7%
Simplified83.7%
Final simplification94.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 9.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ 1.0 (* x1 x1)))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2)))
(if (<= x1 -4e+156)
(+ x1 t_0)
(if (<= x1 -5e+102)
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) t_3))
(if (<= x1 1.8e+137)
(+
x1
(+
t_3
(+
x1
(+
(+
(*
t_2
(+
(* (* t_4 (* x1 2.0)) (- t_4 3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0))))
(* t_1 t_4))
(* x1 (* x1 x1))))))
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ t_0 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 1.0 + (x1 * x1);
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -4e+156) {
tmp = x1 + t_0;
} else if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + t_3);
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_3 + (x1 + (((t_2 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 9.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = 1.0d0 + (x1 * x1)
t_3 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
if (x1 <= (-4d+156)) then
tmp = x1 + t_0
else if (x1 <= (-5d+102)) then
tmp = x1 + ((x1 + (6.0d0 * (x1 ** 4.0d0))) + t_3)
else if (x1 <= 1.8d+137) then
tmp = x1 + (t_3 + (x1 + (((t_2 * (((t_4 * (x1 * 2.0d0)) * (t_4 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_4) - 6.0d0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (t_0 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = 1.0 + (x1 * x1);
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double tmp;
if (x1 <= -4e+156) {
tmp = x1 + t_0;
} else if (x1 <= -5e+102) {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + t_3);
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_3 + (x1 + (((t_2 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 9.0) t_1 = x1 * (x1 * 3.0) t_2 = 1.0 + (x1 * x1) t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2) t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2 tmp = 0 if x1 <= -4e+156: tmp = x1 + t_0 elif x1 <= -5e+102: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + t_3) elif x1 <= 1.8e+137: tmp = x1 + (t_3 + (x1 + (((t_2 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1))))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 9.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(1.0 + Float64(x1 * x1)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (x1 <= -4e+156) tmp = Float64(x1 + t_0); elseif (x1 <= -5e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + t_3)); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)))) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(t_0 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 9.0); t_1 = x1 * (x1 * 3.0); t_2 = 1.0 + (x1 * x1); t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2); t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2; tmp = 0.0; if (x1 <= -4e+156) tmp = x1 + t_0; elseif (x1 <= -5e+102) tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + t_3); elseif (x1 <= 1.8e+137) tmp = x1 + (t_3 + (x1 + (((t_2 * (((t_4 * (x1 * 2.0)) * (t_4 - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1))))); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -4e+156], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, -5e+102], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := 1 + x1 \cdot x1\\
t_3 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_2}\\
t_4 := \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+156}:\\
\;\;\;\;x1 + t_0\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + t_3\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(\left(t_2 \cdot \left(\left(t_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right)\right) + t_1 \cdot t_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(t_0 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -3.9999999999999999e156Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x2 around 0 63.0%
*-commutative63.0%
unpow263.0%
Simplified63.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
unpow2100.0%
associate-*r*100.0%
Simplified100.0%
if -3.9999999999999999e156 < x1 < -5e102Initial program 6.7%
Taylor expanded in x1 around inf 93.3%
*-commutative93.3%
Simplified93.3%
if -5e102 < x1 < 1.8e137Initial program 99.4%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 9.0)))
(t_1 (+ 1.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -1.6e+135)
(+ x1 t_0)
(if (<= x1 1.8e+137)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* 4.0 t_3) 6.0))))
(* 3.0 t_2))))))
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ t_0 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = 1.0 + (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_0;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_2)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 9.0d0)
t_1 = 1.0d0 + (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-1.6d+135)) then
tmp = x1 + t_0
else if (x1 <= 1.8d+137) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_3) - 6.0d0)))) + (3.0d0 * t_2)))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (t_0 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 9.0);
double t_1 = 1.0 + (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_0;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_2)))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 9.0) t_1 = 1.0 + (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -1.6e+135: tmp = x1 + t_0 elif x1 <= 1.8e+137: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_2))))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 9.0)) t_1 = Float64(1.0 + Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -1.6e+135) tmp = Float64(x1 + t_0); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)))) + Float64(3.0 * t_2)))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(t_0 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 9.0); t_1 = 1.0 + (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -1.6e+135) tmp = x1 + t_0; elseif (x1 <= 1.8e+137) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((4.0 * t_3) - 6.0)))) + (3.0 * t_2))))); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_0 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := 1 + x1 \cdot x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t_2 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_0\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_2 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(t_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right)\right) + 3 \cdot t_2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(t_0 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.59999999999999987e135 < x1 < 1.8e137Initial program 96.6%
Taylor expanded in x1 around inf 95.9%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification94.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ 1.0 (* x1 x1)))
(t_2 (* x1 (* x1 9.0)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -1.6e+135)
(+ x1 t_2)
(if (<= x1 1.8e+137)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 t_3) 6.0))
(* (- t_3 3.0) (* (- (* 2.0 x2) x1) (* x1 2.0))))))))))
(+
x1
(+
(* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))
(+ t_2 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 1.0 + (x1 * x1);
double t_2 = x1 * (x1 * 9.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_3) - 6.0)) + ((t_3 - 3.0) * (((2.0 * x2) - x1) * (x1 * 2.0)))))))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = 1.0d0 + (x1 * x1)
t_2 = x1 * (x1 * 9.0d0)
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-1.6d+135)) then
tmp = x1 + t_2
else if (x1 <= 1.8d+137) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * ((4.0d0 * t_3) - 6.0d0)) + ((t_3 - 3.0d0) * (((2.0d0 * x2) - x1) * (x1 * 2.0d0)))))))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)) + (t_2 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = 1.0 + (x1 * x1);
double t_2 = x1 * (x1 * 9.0);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_3) - 6.0)) + ((t_3 - 3.0) * (((2.0 * x2) - x1) * (x1 * 2.0)))))))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = 1.0 + (x1 * x1) t_2 = x1 * (x1 * 9.0) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -1.6e+135: tmp = x1 + t_2 elif x1 <= 1.8e+137: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_3) - 6.0)) + ((t_3 - 3.0) * (((2.0 * x2) - x1) * (x1 * 2.0))))))))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_2 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(1.0 + Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 9.0)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -1.6e+135) tmp = Float64(x1 + t_2); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_3) - 6.0)) + Float64(Float64(t_3 - 3.0) * Float64(Float64(Float64(2.0 * x2) - x1) * Float64(x1 * 2.0)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)) + Float64(t_2 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = 1.0 + (x1 * x1); t_2 = x1 * (x1 * 9.0); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -1.6e+135) tmp = x1 + t_2; elseif (x1 <= 1.8e+137) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * t_3) - 6.0)) + ((t_3 - 3.0) * (((2.0 * x2) - x1) * (x1 * 2.0))))))))); else tmp = x1 + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)) + (t_2 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$3), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 1 + x1 \cdot x1\\
t_2 := x1 \cdot \left(x1 \cdot 9\right)\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_2\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_3 - 6\right) + \left(t_3 - 3\right) \cdot \left(\left(2 \cdot x2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right) + \left(t_2 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.59999999999999987e135 < x1 < 1.8e137Initial program 96.6%
Taylor expanded in x1 around 0 93.0%
Taylor expanded in x1 around inf 92.8%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification91.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (* x1 (* x1 9.0)))
(t_2 (+ 1.0 (* x1 x1)))
(t_3 (- (* 2.0 x2) 3.0)))
(if (<= x1 -1.65e+135)
(+ x1 t_1)
(if (<= x1 1.8e+137)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_2
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2)) 6.0))
(* 4.0 (* x2 (* x1 t_3))))))))))
(+ x1 (+ (* x1 (- (* 4.0 (* x2 t_3)) 2.0)) (+ t_1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * 9.0);
double t_2 = 1.0 + (x1 * x1);
double t_3 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -1.65e+135) {
tmp = x1 + t_1;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + (4.0 * (x2 * (x1 * t_3)))))))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_3)) - 2.0)) + (t_1 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 * (x1 * 9.0d0)
t_2 = 1.0d0 + (x1 * x1)
t_3 = (2.0d0 * x2) - 3.0d0
if (x1 <= (-1.65d+135)) then
tmp = x1 + t_1
else if (x1 <= 1.8d+137) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_2 * (((x1 * x1) * ((4.0d0 * (((t_0 + (2.0d0 * x2)) - x1) / t_2)) - 6.0d0)) + (4.0d0 * (x2 * (x1 * t_3)))))))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_3)) - 2.0d0)) + (t_1 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 * (x1 * 9.0);
double t_2 = 1.0 + (x1 * x1);
double t_3 = (2.0 * x2) - 3.0;
double tmp;
if (x1 <= -1.65e+135) {
tmp = x1 + t_1;
} else if (x1 <= 1.8e+137) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + (4.0 * (x2 * (x1 * t_3)))))))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_3)) - 2.0)) + (t_1 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 * (x1 * 9.0) t_2 = 1.0 + (x1 * x1) t_3 = (2.0 * x2) - 3.0 tmp = 0 if x1 <= -1.65e+135: tmp = x1 + t_1 elif x1 <= 1.8e+137: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + (4.0 * (x2 * (x1 * t_3))))))))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_3)) - 2.0)) + (t_1 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 * Float64(x1 * 9.0)) t_2 = Float64(1.0 + Float64(x1 * x1)) t_3 = Float64(Float64(2.0 * x2) - 3.0) tmp = 0.0 if (x1 <= -1.65e+135) tmp = Float64(x1 + t_1); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2)) - 6.0)) + Float64(4.0 * Float64(x2 * Float64(x1 * t_3)))))))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_3)) - 2.0)) + Float64(t_1 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 * (x1 * 9.0); t_2 = 1.0 + (x1 * x1); t_3 = (2.0 * x2) - 3.0; tmp = 0.0; if (x1 <= -1.65e+135) tmp = x1 + t_1; elseif (x1 <= 1.8e+137) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_2 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_2)) - 6.0)) + (4.0 * (x2 * (x1 * t_3))))))))); else tmp = x1 + ((x1 * ((4.0 * (x2 * t_3)) - 2.0)) + (t_1 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, If[LessEqual[x1, -1.65e+135], N[(x1 + t$95$1), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x2 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$3), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 9\right)\\
t_2 := 1 + x1 \cdot x1\\
t_3 := 2 \cdot x2 - 3\\
\mathbf{if}\;x1 \leq -1.65 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_1\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_2} - 6\right) + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_3\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_3\right) - 2\right) + \left(t_1 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.65e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.65e135 < x1 < 1.8e137Initial program 96.6%
Taylor expanded in x1 around 0 93.0%
Taylor expanded in x1 around inf 92.8%
Taylor expanded in x1 around 0 92.6%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification91.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x1 (* x1 9.0)))
(t_3 (+ 1.0 (* x1 x1)))
(t_4 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3)))
(t_5
(+
x1
(+
t_4
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_3
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3)) 6.0))
(* x1 2.0))))))))))
(if (<= x1 -1.6e+135)
(+ x1 t_2)
(if (<= x1 -40.0)
t_5
(if (<= x1 14500.0)
(+ x1 (+ t_4 (+ x1 (* 4.0 (* x2 (* x1 t_1))))))
(if (<= x1 1.8e+137)
t_5
(+
x1
(+ (* x1 (- (* 4.0 (* x2 t_1)) 2.0)) (+ t_2 (* x2 -6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -40.0) {
tmp = t_5;
} else if (x1 <= 14500.0) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x1 * (x1 * 9.0d0)
t_3 = 1.0d0 + (x1 * x1)
t_4 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)
t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_3 * (((x1 * x1) * ((4.0d0 * (((t_0 + (2.0d0 * x2)) - x1) / t_3)) - 6.0d0)) + (x1 * 2.0d0)))))))
if (x1 <= (-1.6d+135)) then
tmp = x1 + t_2
else if (x1 <= (-40.0d0)) then
tmp = t_5
else if (x1 <= 14500.0d0) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * (x1 * t_1)))))
else if (x1 <= 1.8d+137) then
tmp = t_5
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_1)) - 2.0d0)) + (t_2 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)))))));
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -40.0) {
tmp = t_5;
} else if (x1 <= 14500.0) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (2.0 * x2) - 3.0 t_2 = x1 * (x1 * 9.0) t_3 = 1.0 + (x1 * x1) t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3) t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0))))))) tmp = 0 if x1 <= -1.6e+135: tmp = x1 + t_2 elif x1 <= -40.0: tmp = t_5 elif x1 <= 14500.0: tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_1))))) elif x1 <= 1.8e+137: tmp = t_5 else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x1 * Float64(x1 * 9.0)) t_3 = Float64(1.0 + Float64(x1 * x1)) t_4 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3)) - 6.0)) + Float64(x1 * 2.0)))))))) tmp = 0.0 if (x1 <= -1.6e+135) tmp = Float64(x1 + t_2); elseif (x1 <= -40.0) tmp = t_5; elseif (x1 <= 14500.0) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_1)))))); elseif (x1 <= 1.8e+137) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_1)) - 2.0)) + Float64(t_2 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (2.0 * x2) - 3.0; t_2 = x1 * (x1 * 9.0); t_3 = 1.0 + (x1 * x1); t_4 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3); t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0))))))); tmp = 0.0; if (x1 <= -1.6e+135) tmp = x1 + t_2; elseif (x1 <= -40.0) tmp = t_5; elseif (x1 <= 14500.0) tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_1))))); elseif (x1 <= 1.8e+137) tmp = t_5; else tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, -40.0], t$95$5, If[LessEqual[x1, 14500.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+137], t$95$5, N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 \cdot \left(x1 \cdot 9\right)\\
t_3 := 1 + x1 \cdot x1\\
t_4 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_3}\\
t_5 := x1 + \left(t_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t_0 + t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_3} - 6\right) + x1 \cdot 2\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_2\\
\mathbf{elif}\;x1 \leq -40:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 14500:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_1\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + \left(t_2 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.59999999999999987e135 < x1 < -40 or 14500 < x1 < 1.8e137Initial program 89.0%
Taylor expanded in x1 around 0 77.2%
Taylor expanded in x1 around inf 82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x1 around inf 82.1%
if -40 < x1 < 14500Initial program 99.4%
Taylor expanded in x1 around 0 98.8%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification92.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x1 (* x1 9.0)))
(t_3 (+ 1.0 (* x1 x1)))
(t_4
(*
t_3
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3)) 6.0))
(* x1 2.0))))
(t_5 (* x1 (* x1 x1)))
(t_6 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))))
(if (<= x1 -1.6e+135)
(+ x1 t_2)
(if (<= x1 -140.0)
(+ x1 (+ t_6 (+ x1 (+ t_5 (+ t_4 (* t_0 (* 2.0 x2)))))))
(if (<= x1 14000.0)
(+ x1 (+ t_6 (+ x1 (* 4.0 (* x2 (* x1 t_1))))))
(if (<= x1 1.8e+137)
(+ x1 (+ t_6 (+ x1 (+ t_5 (+ (* 3.0 t_0) t_4)))))
(+
x1
(+ (* x1 (- (* 4.0 (* x2 t_1)) 2.0)) (+ t_2 (* x2 -6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -140.0) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * (2.0 * x2))))));
} else if (x1 <= 14000.0) {
tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x1 * (x1 * 9.0d0)
t_3 = 1.0d0 + (x1 * x1)
t_4 = t_3 * (((x1 * x1) * ((4.0d0 * (((t_0 + (2.0d0 * x2)) - x1) / t_3)) - 6.0d0)) + (x1 * 2.0d0))
t_5 = x1 * (x1 * x1)
t_6 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)
if (x1 <= (-1.6d+135)) then
tmp = x1 + t_2
else if (x1 <= (-140.0d0)) then
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * (2.0d0 * x2))))))
else if (x1 <= 14000.0d0) then
tmp = x1 + (t_6 + (x1 + (4.0d0 * (x2 * (x1 * t_1)))))
else if (x1 <= 1.8d+137) then
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0d0 * t_0) + t_4))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_1)) - 2.0d0)) + (t_2 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -140.0) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * (2.0 * x2))))));
} else if (x1 <= 14000.0) {
tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (2.0 * x2) - 3.0 t_2 = x1 * (x1 * 9.0) t_3 = 1.0 + (x1 * x1) t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)) t_5 = x1 * (x1 * x1) t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3) tmp = 0 if x1 <= -1.6e+135: tmp = x1 + t_2 elif x1 <= -140.0: tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * (2.0 * x2)))))) elif x1 <= 14000.0: tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1))))) elif x1 <= 1.8e+137: tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4)))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x1 * Float64(x1 * 9.0)) t_3 = Float64(1.0 + Float64(x1 * x1)) t_4 = Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3)) - 6.0)) + Float64(x1 * 2.0))) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) tmp = 0.0 if (x1 <= -1.6e+135) tmp = Float64(x1 + t_2); elseif (x1 <= -140.0) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(t_4 + Float64(t_0 * Float64(2.0 * x2))))))); elseif (x1 <= 14000.0) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_1)))))); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(Float64(3.0 * t_0) + t_4))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_1)) - 2.0)) + Float64(t_2 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (2.0 * x2) - 3.0; t_2 = x1 * (x1 * 9.0); t_3 = 1.0 + (x1 * x1); t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)); t_5 = x1 * (x1 * x1); t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3); tmp = 0.0; if (x1 <= -1.6e+135) tmp = x1 + t_2; elseif (x1 <= -140.0) tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * (2.0 * x2)))))); elseif (x1 <= 14000.0) tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1))))); elseif (x1 <= 1.8e+137) tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4)))); else tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, -140.0], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(t$95$4 + N[(t$95$0 * N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 14000.0], N[(x1 + N[(t$95$6 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(N[(3.0 * t$95$0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 \cdot \left(x1 \cdot 9\right)\\
t_3 := 1 + x1 \cdot x1\\
t_4 := t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_3} - 6\right) + x1 \cdot 2\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_3}\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_2\\
\mathbf{elif}\;x1 \leq -140:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_4 + t_0 \cdot \left(2 \cdot x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 14000:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_1\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(3 \cdot t_0 + t_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + \left(t_2 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.59999999999999987e135 < x1 < -140Initial program 79.5%
Taylor expanded in x1 around 0 70.9%
Taylor expanded in x1 around inf 70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in x1 around 0 70.7%
if -140 < x1 < 14000Initial program 99.4%
Taylor expanded in x1 around 0 98.8%
if 14000 < x1 < 1.8e137Initial program 99.3%
Taylor expanded in x1 around 0 84.1%
Taylor expanded in x1 around inf 94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in x1 around inf 94.4%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification92.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (* 2.0 x2) 3.0))
(t_2 (* x1 (* x1 9.0)))
(t_3 (+ 1.0 (* x1 x1)))
(t_4
(*
t_3
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_3)) 6.0))
(* x1 2.0))))
(t_5 (* x1 (* x1 x1)))
(t_6 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))))
(if (<= x1 -1.6e+135)
(+ x1 t_2)
(if (<= x1 -25.0)
(+ x1 (+ t_6 (+ x1 (+ t_5 (+ t_4 (* t_0 (- (* 2.0 x2) x1)))))))
(if (<= x1 7000.0)
(+ x1 (+ t_6 (+ x1 (* 4.0 (* x2 (* x1 t_1))))))
(if (<= x1 1.8e+137)
(+ x1 (+ t_6 (+ x1 (+ t_5 (+ (* 3.0 t_0) t_4)))))
(+
x1
(+ (* x1 (- (* 4.0 (* x2 t_1)) 2.0)) (+ t_2 (* x2 -6.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -25.0) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 7000.0) {
tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (2.0d0 * x2) - 3.0d0
t_2 = x1 * (x1 * 9.0d0)
t_3 = 1.0d0 + (x1 * x1)
t_4 = t_3 * (((x1 * x1) * ((4.0d0 * (((t_0 + (2.0d0 * x2)) - x1) / t_3)) - 6.0d0)) + (x1 * 2.0d0))
t_5 = x1 * (x1 * x1)
t_6 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)
if (x1 <= (-1.6d+135)) then
tmp = x1 + t_2
else if (x1 <= (-25.0d0)) then
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 7000.0d0) then
tmp = x1 + (t_6 + (x1 + (4.0d0 * (x2 * (x1 * t_1)))))
else if (x1 <= 1.8d+137) then
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0d0 * t_0) + t_4))))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_1)) - 2.0d0)) + (t_2 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (2.0 * x2) - 3.0;
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double tmp;
if (x1 <= -1.6e+135) {
tmp = x1 + t_2;
} else if (x1 <= -25.0) {
tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 7000.0) {
tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1)))));
} else if (x1 <= 1.8e+137) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4))));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (2.0 * x2) - 3.0 t_2 = x1 * (x1 * 9.0) t_3 = 1.0 + (x1 * x1) t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)) t_5 = x1 * (x1 * x1) t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3) tmp = 0 if x1 <= -1.6e+135: tmp = x1 + t_2 elif x1 <= -25.0: tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * ((2.0 * x2) - x1)))))) elif x1 <= 7000.0: tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1))))) elif x1 <= 1.8e+137: tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4)))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(2.0 * x2) - 3.0) t_2 = Float64(x1 * Float64(x1 * 9.0)) t_3 = Float64(1.0 + Float64(x1 * x1)) t_4 = Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_3)) - 6.0)) + Float64(x1 * 2.0))) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) tmp = 0.0 if (x1 <= -1.6e+135) tmp = Float64(x1 + t_2); elseif (x1 <= -25.0) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(t_4 + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 7000.0) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_1)))))); elseif (x1 <= 1.8e+137) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(Float64(3.0 * t_0) + t_4))))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_1)) - 2.0)) + Float64(t_2 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (2.0 * x2) - 3.0; t_2 = x1 * (x1 * 9.0); t_3 = 1.0 + (x1 * x1); t_4 = t_3 * (((x1 * x1) * ((4.0 * (((t_0 + (2.0 * x2)) - x1) / t_3)) - 6.0)) + (x1 * 2.0)); t_5 = x1 * (x1 * x1); t_6 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3); tmp = 0.0; if (x1 <= -1.6e+135) tmp = x1 + t_2; elseif (x1 <= -25.0) tmp = x1 + (t_6 + (x1 + (t_5 + (t_4 + (t_0 * ((2.0 * x2) - x1)))))); elseif (x1 <= 7000.0) tmp = x1 + (t_6 + (x1 + (4.0 * (x2 * (x1 * t_1))))); elseif (x1 <= 1.8e+137) tmp = x1 + (t_6 + (x1 + (t_5 + ((3.0 * t_0) + t_4)))); else tmp = x1 + ((x1 * ((4.0 * (x2 * t_1)) - 2.0)) + (t_2 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, -25.0], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(t$95$4 + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7000.0], N[(x1 + N[(t$95$6 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+137], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(N[(3.0 * t$95$0), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$1), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := 2 \cdot x2 - 3\\
t_2 := x1 \cdot \left(x1 \cdot 9\right)\\
t_3 := 1 + x1 \cdot x1\\
t_4 := t_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_3} - 6\right) + x1 \cdot 2\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_3}\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_2\\
\mathbf{elif}\;x1 \leq -25:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(t_4 + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 7000:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_1\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;x1 + \left(t_6 + \left(x1 + \left(t_5 + \left(3 \cdot t_0 + t_4\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_1\right) - 2\right) + \left(t_2 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -1.59999999999999987e135 < x1 < -25Initial program 79.5%
Taylor expanded in x1 around 0 70.9%
Taylor expanded in x1 around inf 70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in x1 around 0 70.8%
if -25 < x1 < 7e3Initial program 99.4%
Taylor expanded in x1 around 0 98.8%
if 7e3 < x1 < 1.8e137Initial program 99.3%
Taylor expanded in x1 around 0 84.1%
Taylor expanded in x1 around inf 94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in x1 around inf 94.4%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification92.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* x1 (* x1 9.0)))
(t_3 (+ 1.0 (* x1 x1)))
(t_4 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3)))
(t_5
(+
x1
(+
t_4
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(* t_3 (+ (* x1 2.0) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -5.5e+102)
(+ x1 t_2)
(if (<= x1 -18000000.0)
t_5
(if (<= x1 13500.0)
(+ x1 (+ t_4 (+ x1 (* 4.0 (* x2 (* x1 t_0))))))
(if (<= x1 1.8e+137)
t_5
(+
x1
(+ (* x1 (- (* 4.0 (* x2 t_0)) 2.0)) (+ t_2 (* x2 -6.0))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((x1 * 2.0) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -5.5e+102) {
tmp = x1 + t_2;
} else if (x1 <= -18000000.0) {
tmp = t_5;
} else if (x1 <= 13500.0) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_0)))));
} else if (x1 <= 1.8e+137) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 * (x1 * 9.0d0)
t_3 = 1.0d0 + (x1 * x1)
t_4 = 3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)
t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0d0 * x2)) - x1) / t_3)) + (t_3 * ((x1 * 2.0d0) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-5.5d+102)) then
tmp = x1 + t_2
else if (x1 <= (-18000000.0d0)) then
tmp = t_5
else if (x1 <= 13500.0d0) then
tmp = x1 + (t_4 + (x1 + (4.0d0 * (x2 * (x1 * t_0)))))
else if (x1 <= 1.8d+137) then
tmp = t_5
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_0)) - 2.0d0)) + (t_2 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 * (x1 * 9.0);
double t_3 = 1.0 + (x1 * x1);
double t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3);
double t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((x1 * 2.0) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -5.5e+102) {
tmp = x1 + t_2;
} else if (x1 <= -18000000.0) {
tmp = t_5;
} else if (x1 <= 13500.0) {
tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_0)))));
} else if (x1 <= 1.8e+137) {
tmp = t_5;
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_2 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 * (x1 * 9.0) t_3 = 1.0 + (x1 * x1) t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3) t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((x1 * 2.0) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -5.5e+102: tmp = x1 + t_2 elif x1 <= -18000000.0: tmp = t_5 elif x1 <= 13500.0: tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_0))))) elif x1 <= 1.8e+137: tmp = t_5 else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_2 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(x1 * Float64(x1 * 9.0)) t_3 = Float64(1.0 + Float64(x1 * x1)) t_4 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3)) + Float64(t_3 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -5.5e+102) tmp = Float64(x1 + t_2); elseif (x1 <= -18000000.0) tmp = t_5; elseif (x1 <= 13500.0) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_0)))))); elseif (x1 <= 1.8e+137) tmp = t_5; else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_0)) - 2.0)) + Float64(t_2 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 * (x1 * 3.0); t_2 = x1 * (x1 * 9.0); t_3 = 1.0 + (x1 * x1); t_4 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3); t_5 = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_1 + (2.0 * x2)) - x1) / t_3)) + (t_3 * ((x1 * 2.0) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -5.5e+102) tmp = x1 + t_2; elseif (x1 <= -18000000.0) tmp = t_5; elseif (x1 <= 13500.0) tmp = x1 + (t_4 + (x1 + (4.0 * (x2 * (x1 * t_0))))); elseif (x1 <= 1.8e+137) tmp = t_5; else tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_2 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+102], N[(x1 + t$95$2), $MachinePrecision], If[LessEqual[x1, -18000000.0], t$95$5, If[LessEqual[x1, 13500.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+137], t$95$5, N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot 9\right)\\
t_3 := 1 + x1 \cdot x1\\
t_4 := 3 \cdot \frac{\left(t_1 - 2 \cdot x2\right) - x1}{t_3}\\
t_5 := x1 + \left(t_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \frac{\left(t_1 + 2 \cdot x2\right) - x1}{t_3} + t_3 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x1 + t_2\\
\mathbf{elif}\;x1 \leq -18000000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq 13500:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+137}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_0\right) - 2\right) + \left(t_2 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102Initial program 2.4%
Taylor expanded in x1 around 0 2.4%
Taylor expanded in x1 around 0 44.0%
Taylor expanded in x2 around 0 44.0%
*-commutative44.0%
unpow244.0%
Simplified44.0%
Taylor expanded in x1 around inf 67.0%
*-commutative67.0%
unpow267.0%
associate-*r*67.0%
Simplified67.0%
if -5.49999999999999981e102 < x1 < -1.8e7 or 13500 < x1 < 1.8e137Initial program 99.3%
Taylor expanded in x1 around 0 85.9%
Taylor expanded in x1 around inf 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x1 around inf 81.2%
if -1.8e7 < x1 < 13500Initial program 99.4%
Taylor expanded in x1 around 0 98.8%
if 1.8e137 < x1 Initial program 7.3%
Taylor expanded in x1 around 0 7.3%
Taylor expanded in x1 around 0 58.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
unpow2100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification90.9%
(FPCore (x1 x2)
:precision binary64
(if (or (<= (* 2.0 x2) -2e+25) (not (<= (* 2.0 x2) 1e+102)))
(+
x1
(+ (+ x1 (* 4.0 (* x2 (* x1 (- (* 2.0 x2) 3.0))))) (* 3.0 (* x2 -2.0))))
(+ x1 (+ (* x1 -2.0) (+ (* x2 -6.0) (* 9.0 (* x1 x1)))))))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -2e+25) || !((2.0 * x2) <= 1e+102)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (((2.0d0 * x2) <= (-2d+25)) .or. (.not. ((2.0d0 * x2) <= 1d+102))) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * (x2 * (-2.0d0))))
else
tmp = x1 + ((x1 * (-2.0d0)) + ((x2 * (-6.0d0)) + (9.0d0 * (x1 * x1))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -2e+25) || !((2.0 * x2) <= 1e+102)) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * (x2 * -2.0)));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -2e+25) or not ((2.0 * x2) <= 1e+102): tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * (x2 * -2.0))) else: tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1)))) return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -2e+25) || !(Float64(2.0 * x2) <= 1e+102)) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(x2 * -2.0)))); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x2 * -6.0) + Float64(9.0 * Float64(x1 * x1))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -2e+25) || ~(((2.0 * x2) <= 1e+102))) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * ((2.0 * x2) - 3.0))))) + (3.0 * (x2 * -2.0))); else tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -2e+25], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e+102]], $MachinePrecision]], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -2 \cdot 10^{+25} \lor \neg \left(2 \cdot x2 \leq 10^{+102}\right):\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x2 \cdot -6 + 9 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -2.00000000000000018e25 or 9.99999999999999977e101 < (*.f64 2 x2) Initial program 70.4%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x1 around 0 80.7%
*-commutative80.7%
Simplified80.7%
if -2.00000000000000018e25 < (*.f64 2 x2) < 9.99999999999999977e101Initial program 67.5%
Taylor expanded in x1 around 0 45.5%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 72.5%
*-commutative72.5%
unpow272.5%
Simplified72.5%
Taylor expanded in x2 around 0 73.9%
*-commutative73.9%
Simplified73.9%
Final simplification76.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0)) (t_1 (* x1 (* x1 9.0))))
(if (<= x1 -7.8e+135)
(+ x1 t_1)
(if (<= x1 5.7e-73)
(+ x1 (+ (+ x1 (* 4.0 (* x2 (* x1 t_0)))) (* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (+ (* x1 (- (* 4.0 (* x2 t_0)) 2.0)) (+ t_1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 9.0);
double tmp;
if (x1 <= -7.8e+135) {
tmp = x1 + t_1;
} else if (x1 <= 5.7e-73) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_1 + (x2 * -6.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x1 * (x1 * 9.0d0)
if (x1 <= (-7.8d+135)) then
tmp = x1 + t_1
else if (x1 <= 5.7d-73) then
tmp = x1 + ((x1 + (4.0d0 * (x2 * (x1 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + ((x1 * ((4.0d0 * (x2 * t_0)) - 2.0d0)) + (t_1 + (x2 * (-6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 9.0);
double tmp;
if (x1 <= -7.8e+135) {
tmp = x1 + t_1;
} else if (x1 <= 5.7e-73) {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_1 + (x2 * -6.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 * (x1 * 9.0) tmp = 0 if x1 <= -7.8e+135: tmp = x1 + t_1 elif x1 <= 5.7e-73: tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_1 + (x2 * -6.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 * Float64(x1 * 9.0)) tmp = 0.0 if (x1 <= -7.8e+135) tmp = Float64(x1 + t_1); elseif (x1 <= 5.7e-73) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * t_0)) - 2.0)) + Float64(t_1 + Float64(x2 * -6.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 * (x1 * 9.0); tmp = 0.0; if (x1 <= -7.8e+135) tmp = x1 + t_1; elseif (x1 <= 5.7e-73) tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + ((x1 * ((4.0 * (x2 * t_0)) - 2.0)) + (t_1 + (x2 * -6.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -7.8e+135], N[(x1 + t$95$1), $MachinePrecision], If[LessEqual[x1, 5.7e-73], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * N[(N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{if}\;x1 \leq -7.8 \cdot 10^{+135}:\\
\;\;\;\;x1 + t_1\\
\mathbf{elif}\;x1 \leq 5.7 \cdot 10^{-73}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot t_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot t_0\right) - 2\right) + \left(t_1 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -7.80000000000000064e135Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 48.2%
Taylor expanded in x2 around 0 48.2%
*-commutative48.2%
unpow248.2%
Simplified48.2%
Taylor expanded in x1 around inf 77.2%
*-commutative77.2%
unpow277.2%
associate-*r*77.2%
Simplified77.2%
if -7.80000000000000064e135 < x1 < 5.6999999999999998e-73Initial program 95.8%
Taylor expanded in x1 around 0 83.7%
Taylor expanded in x1 around 0 84.1%
if 5.6999999999999998e-73 < x1 Initial program 53.9%
Taylor expanded in x1 around 0 28.0%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x2 around 0 74.2%
*-commutative74.2%
unpow274.2%
associate-*l*74.2%
Simplified74.2%
Final simplification79.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= (* 2.0 x2) -5e+179) (not (<= (* 2.0 x2) 1e+163))) (+ x1 (* 8.0 (* x2 (* x1 x2)))) (+ x1 (+ (* x1 -2.0) (+ (* x2 -6.0) (* 9.0 (* x1 x1)))))))
double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e+179) || !((2.0 * x2) <= 1e+163)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (((2.0d0 * x2) <= (-5d+179)) .or. (.not. ((2.0d0 * x2) <= 1d+163))) then
tmp = x1 + (8.0d0 * (x2 * (x1 * x2)))
else
tmp = x1 + ((x1 * (-2.0d0)) + ((x2 * (-6.0d0)) + (9.0d0 * (x1 * x1))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (((2.0 * x2) <= -5e+179) || !((2.0 * x2) <= 1e+163)) {
tmp = x1 + (8.0 * (x2 * (x1 * x2)));
} else {
tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if ((2.0 * x2) <= -5e+179) or not ((2.0 * x2) <= 1e+163): tmp = x1 + (8.0 * (x2 * (x1 * x2))) else: tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1)))) return tmp
function code(x1, x2) tmp = 0.0 if ((Float64(2.0 * x2) <= -5e+179) || !(Float64(2.0 * x2) <= 1e+163)) tmp = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(Float64(x2 * -6.0) + Float64(9.0 * Float64(x1 * x1))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (((2.0 * x2) <= -5e+179) || ~(((2.0 * x2) <= 1e+163))) tmp = x1 + (8.0 * (x2 * (x1 * x2))); else tmp = x1 + ((x1 * -2.0) + ((x2 * -6.0) + (9.0 * (x1 * x1)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[N[(2.0 * x2), $MachinePrecision], -5e+179], N[Not[LessEqual[N[(2.0 * x2), $MachinePrecision], 1e+163]], $MachinePrecision]], N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(N[(x2 * -6.0), $MachinePrecision] + N[(9.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot x2 \leq -5 \cdot 10^{+179} \lor \neg \left(2 \cdot x2 \leq 10^{+163}\right):\\
\;\;\;\;x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + \left(x2 \cdot -6 + 9 \cdot \left(x1 \cdot x1\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 2 x2) < -5e179 or 9.9999999999999994e162 < (*.f64 2 x2) Initial program 74.0%
Taylor expanded in x1 around 0 69.1%
Taylor expanded in x1 around 0 48.5%
Taylor expanded in x2 around 0 58.2%
*-commutative58.2%
unpow258.2%
Simplified58.2%
Taylor expanded in x2 around inf 58.2%
unpow258.2%
associate-*l*72.3%
Simplified72.3%
if -5e179 < (*.f64 2 x2) < 9.9999999999999994e162Initial program 67.1%
Taylor expanded in x1 around 0 49.0%
Taylor expanded in x1 around 0 64.8%
Taylor expanded in x2 around 0 71.1%
*-commutative71.1%
unpow271.1%
Simplified71.1%
Taylor expanded in x2 around 0 72.1%
*-commutative72.1%
Simplified72.1%
Final simplification72.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* x1 9.0)))) (t_1 (+ x1 (* 8.0 (* x2 (* x1 x2))))))
(if (<= x1 -4.1e+145)
t_0
(if (<= x1 -1.42e+23)
(+ x1 (* 3.0 (* x1 (* x1 (+ 3.0 (* 2.0 x2))))))
(if (<= x1 -1.15e-135)
t_1
(if (<= x1 2.85e-86) (* x2 -6.0) (if (<= x1 4.4e+153) t_1 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -4.1e+145) {
tmp = t_0;
} else if (x1 <= -1.42e+23) {
tmp = x1 + (3.0 * (x1 * (x1 * (3.0 + (2.0 * x2)))));
} else if (x1 <= -1.15e-135) {
tmp = t_1;
} else if (x1 <= 2.85e-86) {
tmp = x2 * -6.0;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 * (x1 * 9.0d0))
t_1 = x1 + (8.0d0 * (x2 * (x1 * x2)))
if (x1 <= (-4.1d+145)) then
tmp = t_0
else if (x1 <= (-1.42d+23)) then
tmp = x1 + (3.0d0 * (x1 * (x1 * (3.0d0 + (2.0d0 * x2)))))
else if (x1 <= (-1.15d-135)) then
tmp = t_1
else if (x1 <= 2.85d-86) then
tmp = x2 * (-6.0d0)
else if (x1 <= 4.4d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -4.1e+145) {
tmp = t_0;
} else if (x1 <= -1.42e+23) {
tmp = x1 + (3.0 * (x1 * (x1 * (3.0 + (2.0 * x2)))));
} else if (x1 <= -1.15e-135) {
tmp = t_1;
} else if (x1 <= 2.85e-86) {
tmp = x2 * -6.0;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (x1 * 9.0)) t_1 = x1 + (8.0 * (x2 * (x1 * x2))) tmp = 0 if x1 <= -4.1e+145: tmp = t_0 elif x1 <= -1.42e+23: tmp = x1 + (3.0 * (x1 * (x1 * (3.0 + (2.0 * x2))))) elif x1 <= -1.15e-135: tmp = t_1 elif x1 <= 2.85e-86: tmp = x2 * -6.0 elif x1 <= 4.4e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))) t_1 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) tmp = 0.0 if (x1 <= -4.1e+145) tmp = t_0; elseif (x1 <= -1.42e+23) tmp = Float64(x1 + Float64(3.0 * Float64(x1 * Float64(x1 * Float64(3.0 + Float64(2.0 * x2)))))); elseif (x1 <= -1.15e-135) tmp = t_1; elseif (x1 <= 2.85e-86) tmp = Float64(x2 * -6.0); elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (x1 * 9.0)); t_1 = x1 + (8.0 * (x2 * (x1 * x2))); tmp = 0.0; if (x1 <= -4.1e+145) tmp = t_0; elseif (x1 <= -1.42e+23) tmp = x1 + (3.0 * (x1 * (x1 * (3.0 + (2.0 * x2))))); elseif (x1 <= -1.15e-135) tmp = t_1; elseif (x1 <= 2.85e-86) tmp = x2 * -6.0; elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.1e+145], t$95$0, If[LessEqual[x1, -1.42e+23], N[(x1 + N[(3.0 * N[(x1 * N[(x1 * N[(3.0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.15e-135], t$95$1, If[LessEqual[x1, 2.85e-86], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+145}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -1.42 \cdot 10^{+23}:\\
\;\;\;\;x1 + 3 \cdot \left(x1 \cdot \left(x1 \cdot \left(3 + 2 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.15 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 2.85 \cdot 10^{-86}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -4.1000000000000001e145 or 4.3999999999999999e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 60.6%
Taylor expanded in x2 around 0 83.3%
*-commutative83.3%
unpow283.3%
Simplified83.3%
Taylor expanded in x1 around inf 98.6%
*-commutative98.6%
unpow298.6%
associate-*r*98.6%
Simplified98.6%
if -4.1000000000000001e145 < x1 < -1.42000000000000004e23Initial program 54.8%
Taylor expanded in x1 around 0 7.2%
Taylor expanded in x1 around 0 10.7%
Taylor expanded in x1 around inf 24.4%
associate-*r*24.4%
*-commutative24.4%
associate-*r*24.4%
unpow224.4%
associate-*l*24.4%
*-commutative24.4%
cancel-sign-sub-inv24.4%
metadata-eval24.4%
Simplified24.4%
if -1.42000000000000004e23 < x1 < -1.15e-135 or 2.8500000000000002e-86 < x1 < 4.3999999999999999e153Initial program 99.3%
Taylor expanded in x1 around 0 66.5%
Taylor expanded in x1 around 0 58.1%
Taylor expanded in x2 around 0 62.3%
*-commutative62.3%
unpow262.3%
Simplified62.3%
Taylor expanded in x2 around inf 32.3%
unpow232.3%
associate-*l*37.1%
Simplified37.1%
if -1.15e-135 < x1 < 2.8500000000000002e-86Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in x1 around 0 66.4%
Final simplification61.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (* x1 (* x1 9.0)))) (t_1 (+ x1 (* 8.0 (* x2 (* x1 x2))))))
(if (<= x1 -1.6e+135)
t_0
(if (<= x1 -7.8e-136)
t_1
(if (<= x1 3.1e-86) (* x2 -6.0) (if (<= x1 4.4e+153) t_1 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.6e+135) {
tmp = t_0;
} else if (x1 <= -7.8e-136) {
tmp = t_1;
} else if (x1 <= 3.1e-86) {
tmp = x2 * -6.0;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 + (x1 * (x1 * 9.0d0))
t_1 = x1 + (8.0d0 * (x2 * (x1 * x2)))
if (x1 <= (-1.6d+135)) then
tmp = t_0
else if (x1 <= (-7.8d-136)) then
tmp = t_1
else if (x1 <= 3.1d-86) then
tmp = x2 * (-6.0d0)
else if (x1 <= 4.4d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 * (x1 * 9.0));
double t_1 = x1 + (8.0 * (x2 * (x1 * x2)));
double tmp;
if (x1 <= -1.6e+135) {
tmp = t_0;
} else if (x1 <= -7.8e-136) {
tmp = t_1;
} else if (x1 <= 3.1e-86) {
tmp = x2 * -6.0;
} else if (x1 <= 4.4e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 * (x1 * 9.0)) t_1 = x1 + (8.0 * (x2 * (x1 * x2))) tmp = 0 if x1 <= -1.6e+135: tmp = t_0 elif x1 <= -7.8e-136: tmp = t_1 elif x1 <= 3.1e-86: tmp = x2 * -6.0 elif x1 <= 4.4e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))) t_1 = Float64(x1 + Float64(8.0 * Float64(x2 * Float64(x1 * x2)))) tmp = 0.0 if (x1 <= -1.6e+135) tmp = t_0; elseif (x1 <= -7.8e-136) tmp = t_1; elseif (x1 <= 3.1e-86) tmp = Float64(x2 * -6.0); elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 * (x1 * 9.0)); t_1 = x1 + (8.0 * (x2 * (x1 * x2))); tmp = 0.0; if (x1 <= -1.6e+135) tmp = t_0; elseif (x1 <= -7.8e-136) tmp = t_1; elseif (x1 <= 3.1e-86) tmp = x2 * -6.0; elseif (x1 <= 4.4e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+135], t$95$0, If[LessEqual[x1, -7.8e-136], t$95$1, If[LessEqual[x1, 3.1e-86], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 4.4e+153], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + x1 \cdot \left(x1 \cdot 9\right)\\
t_1 := x1 + 8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+135}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -7.8 \cdot 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-86}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.4 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.59999999999999987e135 or 4.3999999999999999e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 54.5%
Taylor expanded in x2 around 0 74.8%
*-commutative74.8%
unpow274.8%
Simplified74.8%
Taylor expanded in x1 around inf 88.9%
*-commutative88.9%
unpow288.9%
associate-*r*88.9%
Simplified88.9%
if -1.59999999999999987e135 < x1 < -7.79999999999999952e-136 or 3.09999999999999989e-86 < x1 < 4.3999999999999999e153Initial program 94.1%
Taylor expanded in x1 around 0 54.0%
Taylor expanded in x1 around 0 48.1%
Taylor expanded in x2 around 0 51.5%
*-commutative51.5%
unpow251.5%
Simplified51.5%
Taylor expanded in x2 around inf 27.4%
unpow227.4%
associate-*l*31.1%
Simplified31.1%
if -7.79999999999999952e-136 < x1 < 3.09999999999999989e-86Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in x1 around 0 66.4%
Final simplification59.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.4e-50) (not (<= x1 0.185))) (+ x1 (* x1 (* x1 9.0))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.4e-50) || !(x1 <= 0.185)) {
tmp = x1 + (x1 * (x1 * 9.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.4d-50)) .or. (.not. (x1 <= 0.185d0))) then
tmp = x1 + (x1 * (x1 * 9.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.4e-50) || !(x1 <= 0.185)) {
tmp = x1 + (x1 * (x1 * 9.0));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.4e-50) or not (x1 <= 0.185): tmp = x1 + (x1 * (x1 * 9.0)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.4e-50) || !(x1 <= 0.185)) tmp = Float64(x1 + Float64(x1 * Float64(x1 * 9.0))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.4e-50) || ~((x1 <= 0.185))) tmp = x1 + (x1 * (x1 * 9.0)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.4e-50], N[Not[LessEqual[x1, 0.185]], $MachinePrecision]], N[(x1 + N[(x1 * N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.4 \cdot 10^{-50} \lor \neg \left(x1 \leq 0.185\right):\\
\;\;\;\;x1 + x1 \cdot \left(x1 \cdot 9\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -3.40000000000000014e-50 or 0.185 < x1 Initial program 40.3%
Taylor expanded in x1 around 0 11.7%
Taylor expanded in x1 around 0 40.4%
Taylor expanded in x2 around 0 54.1%
*-commutative54.1%
unpow254.1%
Simplified54.1%
Taylor expanded in x1 around inf 52.0%
*-commutative52.0%
unpow252.0%
associate-*r*52.0%
Simplified52.0%
if -3.40000000000000014e-50 < x1 < 0.185Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
Taylor expanded in x1 around 0 54.0%
*-commutative54.0%
Simplified54.0%
Taylor expanded in x1 around 0 54.6%
Final simplification53.2%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 68.7%
Taylor expanded in x1 around 0 53.9%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Final simplification27.7%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 68.7%
Taylor expanded in x1 around 0 53.9%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Taylor expanded in x1 around 0 27.4%
Final simplification27.4%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 68.7%
Taylor expanded in x1 around 0 53.9%
Taylor expanded in x1 around 0 27.7%
*-commutative27.7%
Simplified27.7%
Taylor expanded in x1 around inf 3.6%
Final simplification3.6%
herbie shell --seed 2023192
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))