
(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 26 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 (* x1 (* x1 3.0)))
(t_1 (- (* x2 2.0) x1))
(t_2 (/ (fma 3.0 (* x1 x1) t_1) (fma x1 x1 1.0)))
(t_3 (sqrt (pow (+ x1 (* x2 -6.0)) 2.0)))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ (- (+ (* x2 2.0) t_0) x1) t_4)))
(if (<= x1 -7.6e+153)
t_3
(if (<= x1 -5.4e-148)
(+
x1
(fma
3.0
(/ (- (* 3.0 (* x1 x1)) (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
(* (* x1 t_2) (* x1 3.0))
(*
(fma x1 x1 1.0)
(+
x1
(*
x1
(+ (* 2.0 (* t_2 (+ t_2 -3.0))) (* x1 (fma t_2 4.0 -6.0)))))))))
(if (<= x1 2.8e+140)
(+
x1
(+
(+
x1
(+
(+
(*
t_4
(+
(*
(* (* x1 2.0) t_5)
(-
(* (fma 3.0 (pow x1 2.0) t_1) (/ 1.0 (fma x1 x1 1.0)))
3.0))
(* (* x1 x1) (- (* 4.0 t_5) 6.0))))
(* t_0 t_5))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_4))))
t_3)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x2 * 2.0) - x1;
double t_2 = fma(3.0, (x1 * x1), t_1) / fma(x1, x1, 1.0);
double t_3 = sqrt(pow((x1 + (x2 * -6.0)), 2.0));
double t_4 = (x1 * x1) + 1.0;
double t_5 = (((x2 * 2.0) + t_0) - x1) / t_4;
double tmp;
if (x1 <= -7.6e+153) {
tmp = t_3;
} else if (x1 <= -5.4e-148) {
tmp = x1 + fma(3.0, (((3.0 * (x1 * x1)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (((x1 * t_2) * (x1 * 3.0)) + (fma(x1, x1, 1.0) * (x1 + (x1 * ((2.0 * (t_2 * (t_2 + -3.0))) + (x1 * fma(t_2, 4.0, -6.0))))))));
} else if (x1 <= 2.8e+140) {
tmp = x1 + ((x1 + (((t_4 * ((((x1 * 2.0) * t_5) * ((fma(3.0, pow(x1, 2.0), t_1) * (1.0 / fma(x1, x1, 1.0))) - 3.0)) + ((x1 * x1) * ((4.0 * t_5) - 6.0)))) + (t_0 * t_5)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_4)));
} else {
tmp = t_3;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x2 * 2.0) - x1) t_2 = Float64(fma(3.0, Float64(x1 * x1), t_1) / fma(x1, x1, 1.0)) t_3 = sqrt((Float64(x1 + Float64(x2 * -6.0)) ^ 2.0)) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_4) tmp = 0.0 if (x1 <= -7.6e+153) tmp = t_3; elseif (x1 <= -5.4e-148) tmp = Float64(x1 + fma(3.0, Float64(Float64(Float64(3.0 * Float64(x1 * x1)) - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(Float64(Float64(x1 * t_2) * Float64(x1 * 3.0)) + Float64(fma(x1, x1, 1.0) * Float64(x1 + Float64(x1 * Float64(Float64(2.0 * Float64(t_2 * Float64(t_2 + -3.0))) + Float64(x1 * fma(t_2, 4.0, -6.0))))))))); elseif (x1 <= 2.8e+140) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_4 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(Float64(fma(3.0, (x1 ^ 2.0), t_1) * Float64(1.0 / fma(x1, x1, 1.0))) - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_5) - 6.0)))) + Float64(t_0 * t_5)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_4)))); else tmp = t_3; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(3.0 * N[(x1 * x1), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[Power[N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]}, If[LessEqual[x1, -7.6e+153], t$95$3, If[LessEqual[x1, -5.4e-148], N[(x1 + N[(3.0 * N[(N[(N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * t$95$2), $MachinePrecision] * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 + N[(x1 * N[(N[(2.0 * N[(t$95$2 * N[(t$95$2 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(t$95$2 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.8e+140], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$4 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + t$95$1), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$5), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x2 \cdot 2 - x1\\
t_2 := \frac{\mathsf{fma}\left(3, x1 \cdot x1, t_1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_3 := \sqrt{{\left(x1 + x2 \cdot -6\right)}^{2}}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_4}\\
\mathbf{if}\;x1 \leq -7.6 \cdot 10^{+153}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq -5.4 \cdot 10^{-148}:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{3 \cdot \left(x1 \cdot x1\right) - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, \left(x1 \cdot t_2\right) \cdot \left(x1 \cdot 3\right) + \mathsf{fma}\left(x1, x1, 1\right) \cdot \left(x1 + x1 \cdot \left(2 \cdot \left(t_2 \cdot \left(t_2 + -3\right)\right) + x1 \cdot \mathsf{fma}\left(t_2, 4, -6\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.8 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_4 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_5\right) \cdot \left(\mathsf{fma}\left(3, {x1}^{2}, t_1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t_5 - 6\right)\right) + t_0 \cdot t_5\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_4}\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x1 < -7.59999999999999933e153 or 2.79999999999999983e140 < x1 Initial program 1.6%
Taylor expanded in x1 around 0 1.6%
Taylor expanded in x1 around 0 3.4%
*-commutative3.4%
Simplified3.4%
add-sqr-sqrt3.3%
sqrt-unprod100.0%
pow1100.0%
pow1100.0%
pow-sqr100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -7.59999999999999933e153 < x1 < -5.39999999999999976e-148Initial program 76.7%
Simplified99.7%
if -5.39999999999999976e-148 < x1 < 2.79999999999999983e140Initial program 98.7%
associate--l+98.7%
associate-*r*98.7%
fma-udef98.7%
fma-def98.7%
div-inv98.8%
pow298.8%
Applied egg-rr98.8%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (sqrt (pow (+ x1 (* x2 -6.0)) 2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_2)))
(t_4 (/ (- (+ (* x2 2.0) t_1) x1) t_2)))
(if (<= x1 -1.35e+154)
t_0
(if (<= x1 -5.6e+102)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 2.8e+140)
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(*
(* (* x1 2.0) t_4)
(-
(*
(fma 3.0 (pow x1 2.0) (- (* x2 2.0) x1))
(/ 1.0 (fma x1 x1 1.0)))
3.0))
(* (* x1 x1) (- (* 4.0 t_4) 6.0))))
(* t_1 t_4))
(* x1 (* x1 x1))))
t_3))
t_0)))))
double code(double x1, double x2) {
double t_0 = sqrt(pow((x1 + (x2 * -6.0)), 2.0));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double t_4 = (((x2 * 2.0) + t_1) - x1) / t_2;
double tmp;
if (x1 <= -1.35e+154) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 2.8e+140) {
tmp = x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_4) * ((fma(3.0, pow(x1, 2.0), ((x2 * 2.0) - x1)) * (1.0 / fma(x1, x1, 1.0))) - 3.0)) + ((x1 * x1) * ((4.0 * t_4) - 6.0)))) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + t_3);
} else {
tmp = t_0;
}
return tmp;
}
function code(x1, x2) t_0 = sqrt((Float64(x1 + Float64(x2 * -6.0)) ^ 2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_2)) t_4 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_2) tmp = 0.0 if (x1 <= -1.35e+154) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 2.8e+140) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(Float64(fma(3.0, (x1 ^ 2.0), Float64(Float64(x2 * 2.0) - x1)) * Float64(1.0 / fma(x1, x1, 1.0))) - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)))) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + t_3)); else tmp = t_0; end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.8e+140], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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] + t$95$3), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(x1 + x2 \cdot -6\right)}^{2}}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_2}\\
t_4 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 2.8 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot 2 - x1\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)} - 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) + t_3\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154 or 2.79999999999999983e140 < x1 Initial program 1.6%
Taylor expanded in x1 around 0 1.6%
Taylor expanded in x1 around 0 3.4%
*-commutative3.4%
Simplified3.4%
add-sqr-sqrt3.3%
sqrt-unprod100.0%
pow1100.0%
pow1100.0%
pow-sqr100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -1.35000000000000003e154 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5.60000000000000037e102 < x1 < 2.79999999999999983e140Initial program 98.9%
associate--l+98.9%
associate-*r*98.9%
fma-udef98.9%
fma-def98.9%
div-inv98.9%
pow298.9%
Applied egg-rr98.9%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ (* x2 2.0) t_1) x1) t_0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_2)
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0)))))))))))
(if (<= t_3 INFINITY)
t_3
(+
x1
(+
(* x2 -6.0)
(+
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (- (* x2 -12.0) 2.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double t_3 = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double t_3 = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (((x2 * 2.0) + t_1) - x1) / t_0 t_3 = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + ((x2 * -6.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0))))))))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (((x2 * 2.0) + t_1) - x1) / t_0; t_3 = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + ((x2 * -6.0) + ((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0}\\
t_3 := x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_2 + t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\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 x2 around 0 1.7%
*-commutative1.7%
associate-*l*1.7%
Simplified1.7%
Taylor expanded in x1 around 0 54.1%
Final simplification85.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (sqrt (pow (+ x1 (* x2 -6.0)) 2.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_2)))
(t_4 (/ (- (+ (* x2 2.0) t_1) x1) t_2)))
(if (<= x1 -1.35e+154)
t_0
(if (<= x1 -5.6e+102)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 2.8e+140)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_4)
(*
t_2
(+
(* (* x1 x1) (- (* 4.0 t_4) 6.0))
(* (* (* x1 2.0) t_4) (- t_4 3.0)))))))))
t_0)))))
double code(double x1, double x2) {
double t_0 = sqrt(pow((x1 + (x2 * -6.0)), 2.0));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double t_4 = (((x2 * 2.0) + t_1) - x1) / t_2;
double tmp;
if (x1 <= -1.35e+154) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 2.8e+140) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (((x1 * 2.0) * t_4) * (t_4 - 3.0))))))));
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = sqrt(((x1 + (x2 * (-6.0d0))) ** 2.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_2)
t_4 = (((x2 * 2.0d0) + t_1) - x1) / t_2
if (x1 <= (-1.35d+154)) then
tmp = t_0
else if (x1 <= (-5.6d+102)) then
tmp = x1 + (t_3 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 2.8d+140) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * (((x1 * x1) * ((4.0d0 * t_4) - 6.0d0)) + (((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0))))))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = Math.sqrt(Math.pow((x1 + (x2 * -6.0)), 2.0));
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double t_4 = (((x2 * 2.0) + t_1) - x1) / t_2;
double tmp;
if (x1 <= -1.35e+154) {
tmp = t_0;
} else if (x1 <= -5.6e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 2.8e+140) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (((x1 * 2.0) * t_4) * (t_4 - 3.0))))))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = math.sqrt(math.pow((x1 + (x2 * -6.0)), 2.0)) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2) t_4 = (((x2 * 2.0) + t_1) - x1) / t_2 tmp = 0 if x1 <= -1.35e+154: tmp = t_0 elif x1 <= -5.6e+102: tmp = x1 + (t_3 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 2.8e+140: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (((x1 * 2.0) * t_4) * (t_4 - 3.0)))))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = sqrt((Float64(x1 + Float64(x2 * -6.0)) ^ 2.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_2)) t_4 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_2) tmp = 0.0 if (x1 <= -1.35e+154) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 2.8e+140) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_4) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0))))))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = sqrt(((x1 + (x2 * -6.0)) ^ 2.0)); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2); t_4 = (((x2 * 2.0) + t_1) - x1) / t_2; tmp = 0.0; if (x1 <= -1.35e+154) tmp = t_0; elseif (x1 <= -5.6e+102) tmp = x1 + (t_3 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 2.8e+140) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_4) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (((x1 * 2.0) * t_4) * (t_4 - 3.0)))))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], t$95$0, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.8e+140], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$4), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(x1 + x2 \cdot -6\right)}^{2}}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_2}\\
t_4 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 2.8 \cdot 10^{+140}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot t_4 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154 or 2.79999999999999983e140 < x1 Initial program 1.6%
Taylor expanded in x1 around 0 1.6%
Taylor expanded in x1 around 0 3.4%
*-commutative3.4%
Simplified3.4%
add-sqr-sqrt3.3%
sqrt-unprod100.0%
pow1100.0%
pow1100.0%
pow-sqr100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -1.35000000000000003e154 < x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5.60000000000000037e102 < x1 < 2.79999999999999983e140Initial program 98.9%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1))
(t_3 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 -1.35e+154)
(+
x1
(+
(* x2 -6.0)
(+
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (- (* x2 -12.0) 2.0)))))
(if (<= x1 -3e+101)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.8e+83)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0)))))))))
(log1p (expm1 (+ x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -3e+101) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.8e+83) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = log1p(expm1((x1 + (x2 * -6.0))));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -3e+101) {
tmp = x1 + (t_3 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 1.8e+83) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = Math.log1p(Math.expm1((x1 + (x2 * -6.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1) tmp = 0 if x1 <= -1.35e+154: tmp = x1 + ((x2 * -6.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))) elif x1 <= -3e+101: tmp = x1 + (t_3 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 1.8e+83: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))) else: tmp = math.log1p(math.expm1((x1 + (x2 * -6.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))))); elseif (x1 <= -3e+101) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.8e+83) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0))))))))); else tmp = log1p(expm1(Float64(x1 + Float64(x2 * -6.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3e+101], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.8e+83], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
t_3 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{+101}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.8 \cdot 10^{+83}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(x1 + x2 \cdot -6\right)\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.4%
if -1.35000000000000003e154 < x1 < -2.99999999999999993e101Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -2.99999999999999993e101 < x1 < 1.7999999999999999e83Initial program 98.8%
if 1.7999999999999999e83 < x1 Initial program 28.9%
Taylor expanded in x1 around 0 6.3%
Taylor expanded in x1 around 0 6.3%
*-commutative6.3%
Simplified6.3%
log1p-expm1-u92.1%
Applied egg-rr92.1%
Final simplification93.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1))
(t_3 (* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0)))))
(t_4 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 -1.35e+154)
(+ x1 (+ (* x2 -6.0) (+ t_3 (* x1 (- (* x2 -12.0) 2.0)))))
(if (<= x1 -5e+102)
(+ x1 (+ t_4 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_4
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0)))))))))
(+
x1
(+
(* x2 -6.0)
(+ t_3 (* x1 (- (* 4.0 (* x2 (- (* x2 2.0) 3.0))) 2.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_4 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.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 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
t_3 = 3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))
t_4 = 3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)
if (x1 <= (-1.35d+154)) then
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x1 * ((x2 * (-12.0d0)) - 2.0d0))))
else if (x1 <= (-5d+102)) then
tmp = x1 + (t_4 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0))))))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (t_3 + (x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) - 2.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) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)));
double t_4 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -5e+102) {
tmp = x1 + (t_4 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 t_3 = 3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0))) t_4 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1) tmp = 0 if x1 <= -1.35e+154: tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((x2 * -12.0) - 2.0)))) elif x1 <= -5e+102: tmp = x1 + (t_4 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 1.35e+154: tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))) else: tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.0)))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) t_3 = Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) t_4 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))))); elseif (x1 <= -5e+102) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0))))))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(t_3 + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) - 2.0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; t_3 = 3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0))); t_4 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1); tmp = 0.0; if (x1 <= -1.35e+154) tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((x2 * -12.0) - 2.0)))); elseif (x1 <= -5e+102) tmp = x1 + (t_4 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_4 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))); else tmp = x1 + ((x2 * -6.0) + (t_3 + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) - 2.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5e+102], N[(x1 + N[(t$95$4 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$4 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(t$95$3 + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
t_3 := 3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right)\\
t_4 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t_3 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_4 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(t_3 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) - 2\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.4%
if -1.35000000000000003e154 < x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < 1.35000000000000003e154Initial program 98.9%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 77.8%
Final simplification92.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1))
(t_3 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))))
(if (<= x1 -1.35e+154)
(+
x1
(+
(* x2 -6.0)
(+
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (- (* x2 -12.0) 2.0)))))
(if (<= x1 -5e+102)
(+ x1 (+ t_3 (+ x1 (* 6.0 (pow x1 4.0)))))
(if (<= x1 2.3e+132)
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0)))))))))
(+ x1 (* (pow x2 2.0) (* x1 8.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -5e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * pow(x1, 4.0))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = x1 + (pow(x2, 2.0) * (x1 * 8.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) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
t_3 = 3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)
if (x1 <= (-1.35d+154)) then
tmp = x1 + ((x2 * (-6.0d0)) + ((3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))) + (x1 * ((x2 * (-12.0d0)) - 2.0d0))))
else if (x1 <= (-5d+102)) then
tmp = x1 + (t_3 + (x1 + (6.0d0 * (x1 ** 4.0d0))))
else if (x1 <= 2.3d+132) then
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0))))))))
else
tmp = x1 + ((x2 ** 2.0d0) * (x1 * 8.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) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double tmp;
if (x1 <= -1.35e+154) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= -5e+102) {
tmp = x1 + (t_3 + (x1 + (6.0 * Math.pow(x1, 4.0))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0))))))));
} else {
tmp = x1 + (Math.pow(x2, 2.0) * (x1 * 8.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1) tmp = 0 if x1 <= -1.35e+154: tmp = x1 + ((x2 * -6.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))) elif x1 <= -5e+102: tmp = x1 + (t_3 + (x1 + (6.0 * math.pow(x1, 4.0)))) elif x1 <= 2.3e+132: tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))) else: tmp = x1 + (math.pow(x2, 2.0) * (x1 * 8.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) tmp = 0.0 if (x1 <= -1.35e+154) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))))); elseif (x1 <= -5e+102) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0))))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0))))))))); else tmp = Float64(x1 + Float64((x2 ^ 2.0) * Float64(x1 * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; t_3 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1); tmp = 0.0; if (x1 <= -1.35e+154) tmp = x1 + ((x2 * -6.0) + ((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))); elseif (x1 <= -5e+102) tmp = x1 + (t_3 + (x1 + (6.0 * (x1 ^ 4.0)))); elseif (x1 <= 2.3e+132) tmp = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))))))); else tmp = x1 + ((x2 ^ 2.0) * (x1 * 8.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.35e+154], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5e+102], N[(x1 + N[(t$95$3 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x2, 2.0], $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
t_3 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + 6 \cdot {x1}^{4}\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x2}^{2} \cdot \left(x1 \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -1.35000000000000003e154Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
associate-*l*0.0%
Simplified0.0%
Taylor expanded in x1 around 0 69.4%
if -1.35000000000000003e154 < x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < 2.3000000000000002e132Initial program 98.9%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x2 around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*61.5%
Simplified61.5%
Final simplification90.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ (* x2 2.0) t_1) x1) t_0)))
(if (<= x1 -5.6e+102)
(+
x1
(+
(* x2 -6.0)
(+
(* 3.0 (* (pow x1 2.0) (- 3.0 (* x2 -2.0))))
(* x1 (- (* x2 -12.0) 2.0)))))
(if (<= x1 2.3e+132)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0))))
(* 3.0 t_1))))))
(+ x1 (* (pow x2 2.0) (* x1 8.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (pow(x2, 2.0) * (x1 * 8.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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (((x2 * 2.0d0) + t_1) - x1) / t_0
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + ((3.0d0 * ((x1 ** 2.0d0) * (3.0d0 - (x2 * (-2.0d0))))) + (x1 * ((x2 * (-12.0d0)) - 2.0d0))))
else if (x1 <= 2.3d+132) then
tmp = x1 + ((3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)))) + (3.0d0 * t_1)))))
else
tmp = x1 + ((x2 ** 2.0d0) * (x1 * 8.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + ((3.0 * (Math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (Math.pow(x2, 2.0) * (x1 * 8.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (((x2 * 2.0) + t_1) - x1) / t_0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + ((3.0 * (math.pow(x1, 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))) elif x1 <= 2.3e+132: tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1))))) else: tmp = x1 + (math.pow(x2, 2.0) * (x1 * 8.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(3.0 * Float64((x1 ^ 2.0) * Float64(3.0 - Float64(x2 * -2.0)))) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0))))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)))) + Float64(3.0 * t_1)))))); else tmp = Float64(x1 + Float64((x2 ^ 2.0) * Float64(x1 * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (((x2 * 2.0) + t_1) - x1) / t_0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + ((3.0 * ((x1 ^ 2.0) * (3.0 - (x2 * -2.0)))) + (x1 * ((x2 * -12.0) - 2.0)))); elseif (x1 <= 2.3e+132) tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1))))); else tmp = x1 + ((x2 ^ 2.0) * (x1 * 8.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(3.0 * N[(N[Power[x1, 2.0], $MachinePrecision] * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x2, 2.0], $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(3 \cdot \left({x1}^{2} \cdot \left(3 - x2 \cdot -2\right)\right) + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x2}^{2} \cdot \left(x1 \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 56.3%
if -5.60000000000000037e102 < x1 < 2.3000000000000002e132Initial program 98.9%
Taylor expanded in x1 around inf 97.9%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x2 around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*61.5%
Simplified61.5%
Final simplification85.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ (* x2 2.0) t_1) x1) t_0)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2.3e+132)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* x1 x1) (- (* 4.0 t_2) 6.0))
(* (* (* x1 2.0) t_2) (- t_2 3.0))))
(* 3.0 t_1))))))
(+ x1 (* (pow x2 2.0) (* x1 8.0)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (pow(x2, 2.0) * (x1 * 8.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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (((x2 * 2.0d0) + t_1) - x1) / t_0
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2.3d+132) then
tmp = x1 + ((3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0d0 * t_2) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)))) + (3.0d0 * t_1)))))
else
tmp = x1 + ((x2 ** 2.0d0) * (x1 * 8.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (((x2 * 2.0) + t_1) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 + (Math.pow(x2, 2.0) * (x1 * 8.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (((x2 * 2.0) + t_1) - x1) / t_0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2.3e+132: tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1))))) else: tmp = x1 + (math.pow(x2, 2.0) * (x1 * 8.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)))) + Float64(3.0 * t_1)))))); else tmp = Float64(x1 + Float64((x2 ^ 2.0) * Float64(x1 * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (((x2 * 2.0) + t_1) - x1) / t_0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2.3e+132) tmp = x1 + ((3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((x1 * x1) * ((4.0 * t_2) - 6.0)) + (((x1 * 2.0) * t_2) * (t_2 - 3.0)))) + (3.0 * t_1))))); else tmp = x1 + ((x2 ^ 2.0) * (x1 * 8.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x2, 2.0], $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_0}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_2 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right)\right) + 3 \cdot t_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x2}^{2} \cdot \left(x1 \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < 2.3000000000000002e132Initial program 98.9%
Taylor expanded in x1 around inf 97.9%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x2 around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*61.5%
Simplified61.5%
Final simplification76.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2.3e+132)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))
(* (* x2 2.0) t_0))))))
(+ x1 (* (pow x2 2.0) (* x1 8.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0)))));
} else {
tmp = x1 + (pow(x2, 2.0) * (x1 * 8.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2.3d+132) then
tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + ((x2 * 2.0d0) * t_0)))))
else
tmp = x1 + ((x2 ** 2.0d0) * (x1 * 8.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) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0)))));
} else {
tmp = x1 + (Math.pow(x2, 2.0) * (x1 * 8.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2.3e+132: tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0))))) else: tmp = x1 + (math.pow(x2, 2.0) * (x1 * 8.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(Float64(x2 * 2.0) * t_0)))))); else tmp = Float64(x1 + Float64((x2 ^ 2.0) * Float64(x1 * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2.3e+132) tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0))))); else tmp = x1 + ((x2 ^ 2.0) * (x1 * 8.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $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[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x2, 2.0], $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x2 \cdot 2\right) \cdot t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x2}^{2} \cdot \left(x1 \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < 2.3000000000000002e132Initial program 98.9%
Taylor expanded in x1 around 0 95.8%
Taylor expanded in x1 around inf 94.8%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x2 around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*61.5%
Simplified61.5%
Final simplification74.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2.3e+132)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (* (pow x2 2.0) (* x1 8.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (pow(x2, 2.0) * (x1 * 8.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2.3d+132) then
tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + ((x2 ** 2.0d0) * (x1 * 8.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) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (Math.pow(x2, 2.0) * (x1 * 8.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2.3e+132: tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (math.pow(x2, 2.0) * (x1 * 8.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64((x2 ^ 2.0) * Float64(x1 * 8.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2.3e+132) tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + ((x2 ^ 2.0) * (x1 * 8.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[Power[x2, 2.0], $MachinePrecision] * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot t_2 + t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + {x2}^{2} \cdot \left(x1 \cdot 8\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < 2.3000000000000002e132Initial program 98.9%
Taylor expanded in x1 around inf 95.8%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x2 around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*l*61.5%
Simplified61.5%
Final simplification75.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ (* x2 2.0) t_0) x1) t_1)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2.3e+132)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))
(* (* x2 2.0) t_0))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = (((x2 * 2.0d0) + t_0) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2.3d+132) then
tmp = x1 + ((3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + ((x2 * 2.0d0) * t_0)))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.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) + 1.0;
double t_2 = (((x2 * 2.0) + t_0) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2.3e+132) {
tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0)))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = (((x2 * 2.0) + t_0) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2.3e+132: tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(Float64(x2 * 2.0) * t_0)))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = (((x2 * 2.0) + t_0) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2.3e+132) tmp = x1 + ((3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + ((x2 * 2.0) * t_0))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $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[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x2 * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_2\right) \cdot \left(t_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + \left(x2 \cdot 2\right) \cdot t_0\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < 2.3000000000000002e132Initial program 98.9%
Taylor expanded in x1 around 0 95.8%
Taylor expanded in x1 around inf 94.8%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x1 around inf 58.7%
Final simplification74.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* x2 2.0)) x1) t_2)))
(t_4 (/ (- (+ (* x2 2.0) t_1) x1) t_2)))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 9e+30)
(+
x1
(+
t_3
(+
x1
(+
t_0
(+
(* (* x2 2.0) t_1)
(*
t_2
(+
(* (* x1 x1) 6.0)
(* (- t_4 3.0) (* (- (* x2 2.0) x1) (* x1 2.0))))))))))
(if (<= x1 2.3e+132)
(+
x1
(+
t_3
(+
x1
(+
t_0
(+
(* 3.0 t_1)
(*
t_2
(+ (* (* x1 x1) (- (* 4.0 t_4) 6.0)) (* 12.0 (/ x2 x1)))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double t_4 = (((x2 * 2.0) + t_1) - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 9e+30) {
tmp = x1 + (t_3 + (x1 + (t_0 + (((x2 * 2.0) * t_1) + (t_2 * (((x1 * x1) * 6.0) + ((t_4 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + (t_3 + (x1 + (t_0 + ((3.0 * t_1) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (12.0 * (x2 / x1))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = 3.0d0 * (((t_1 - (x2 * 2.0d0)) - x1) / t_2)
t_4 = (((x2 * 2.0d0) + t_1) - x1) / t_2
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 9d+30) then
tmp = x1 + (t_3 + (x1 + (t_0 + (((x2 * 2.0d0) * t_1) + (t_2 * (((x1 * x1) * 6.0d0) + ((t_4 - 3.0d0) * (((x2 * 2.0d0) - x1) * (x1 * 2.0d0)))))))))
else if (x1 <= 2.3d+132) then
tmp = x1 + (t_3 + (x1 + (t_0 + ((3.0d0 * t_1) + (t_2 * (((x1 * x1) * ((4.0d0 * t_4) - 6.0d0)) + (12.0d0 * (x2 / x1))))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2);
double t_4 = (((x2 * 2.0) + t_1) - x1) / t_2;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 9e+30) {
tmp = x1 + (t_3 + (x1 + (t_0 + (((x2 * 2.0) * t_1) + (t_2 * (((x1 * x1) * 6.0) + ((t_4 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0)))))))));
} else if (x1 <= 2.3e+132) {
tmp = x1 + (t_3 + (x1 + (t_0 + ((3.0 * t_1) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (12.0 * (x2 / x1))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2) t_4 = (((x2 * 2.0) + t_1) - x1) / t_2 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 9e+30: tmp = x1 + (t_3 + (x1 + (t_0 + (((x2 * 2.0) * t_1) + (t_2 * (((x1 * x1) * 6.0) + ((t_4 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0))))))))) elif x1 <= 2.3e+132: tmp = x1 + (t_3 + (x1 + (t_0 + ((3.0 * t_1) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (12.0 * (x2 / x1)))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(x2 * 2.0)) - x1) / t_2)) t_4 = Float64(Float64(Float64(Float64(x2 * 2.0) + t_1) - x1) / t_2) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 9e+30) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(Float64(Float64(x2 * 2.0) * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(t_4 - 3.0) * Float64(Float64(Float64(x2 * 2.0) - x1) * Float64(x1 * 2.0)))))))))); elseif (x1 <= 2.3e+132) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(Float64(3.0 * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_4) - 6.0)) + Float64(12.0 * Float64(x2 / x1))))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = 3.0 * (((t_1 - (x2 * 2.0)) - x1) / t_2); t_4 = (((x2 * 2.0) + t_1) - x1) / t_2; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 9e+30) tmp = x1 + (t_3 + (x1 + (t_0 + (((x2 * 2.0) * t_1) + (t_2 * (((x1 * x1) * 6.0) + ((t_4 - 3.0) * (((x2 * 2.0) - x1) * (x1 * 2.0))))))))); elseif (x1 <= 2.3e+132) tmp = x1 + (t_3 + (x1 + (t_0 + ((3.0 * t_1) + (t_2 * (((x1 * x1) * ((4.0 * t_4) - 6.0)) + (12.0 * (x2 / x1)))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$1 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9e+30], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(N[(N[(x2 * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(N[(x2 * 2.0), $MachinePrecision] - x1), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(N[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$4), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(12.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t_1 - x2 \cdot 2\right) - x1}{t_2}\\
t_4 := \frac{\left(x2 \cdot 2 + t_1\right) - x1}{t_2}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 9 \cdot 10^{+30}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(\left(x2 \cdot 2\right) \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(t_4 - 3\right) \cdot \left(\left(x2 \cdot 2 - x1\right) \cdot \left(x1 \cdot 2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_0 + \left(3 \cdot t_1 + t_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(4 \cdot t_4 - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < 8.9999999999999999e30Initial program 98.8%
Taylor expanded in x1 around 0 96.5%
Taylor expanded in x1 around 0 94.8%
+-commutative94.8%
mul-1-neg94.8%
sub-neg94.8%
Simplified94.8%
Taylor expanded in x1 around inf 94.6%
if 8.9999999999999999e30 < x1 < 2.3000000000000002e132Initial program 99.4%
Taylor expanded in x2 around inf 99.4%
associate-*r/99.4%
associate-/l*99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around inf 90.8%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x1 around inf 58.7%
Final simplification74.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (/ (- (- t_0 (* x2 2.0)) x1) t_1)))
(t_3
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+
(* (* x1 x1) (- (* 4.0 (/ (- (+ (* x2 2.0) t_0) x1) t_1)) 6.0))
(* 12.0 (/ x2 x1)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 -0.3)
t_3
(if (<= x1 30000.0)
(+
x1
(+
t_2
(+ x1 (* 4.0 (+ (* (* x2 2.0) (* x1 x2)) (* -3.0 (* x1 x2)))))))
(if (<= x1 2.3e+132)
t_3
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_0) - x1) / t_1)) - 6.0)) + (12.0 * (x2 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -0.3) {
tmp = t_3;
} else if (x1 <= 30000.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 2.3e+132) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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) + 1.0d0
t_2 = 3.0d0 * (((t_0 - (x2 * 2.0d0)) - x1) / t_1)
t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * (((x1 * x1) * ((4.0d0 * ((((x2 * 2.0d0) + t_0) - x1) / t_1)) - 6.0d0)) + (12.0d0 * (x2 / x1))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= (-0.3d0)) then
tmp = t_3
else if (x1 <= 30000.0d0) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (((x2 * 2.0d0) * (x1 * x2)) + ((-3.0d0) * (x1 * x2))))))
else if (x1 <= 2.3d+132) then
tmp = t_3
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.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) + 1.0;
double t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_0) - x1) / t_1)) - 6.0)) + (12.0 * (x2 / x1))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= -0.3) {
tmp = t_3;
} else if (x1 <= 30000.0) {
tmp = x1 + (t_2 + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else if (x1 <= 2.3e+132) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1) t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_0) - x1) / t_1)) - 6.0)) + (12.0 * (x2 / x1)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= -0.3: tmp = t_3 elif x1 <= 30000.0: tmp = x1 + (t_2 + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2)))))) elif x1 <= 2.3e+132: tmp = t_3 else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(x2 * 2.0)) - x1) / t_1)) t_3 = Float64(x1 + Float64(t_2 + 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 * Float64(Float64(Float64(Float64(x2 * 2.0) + t_0) - x1) / t_1)) - 6.0)) + Float64(12.0 * Float64(x2 / x1))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= -0.3) tmp = t_3; elseif (x1 <= 30000.0) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(Float64(Float64(x2 * 2.0) * Float64(x1 * x2)) + Float64(-3.0 * Float64(x1 * x2))))))); elseif (x1 <= 2.3e+132) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (((t_0 - (x2 * 2.0)) - x1) / t_1); t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (((x1 * x1) * ((4.0 * ((((x2 * 2.0) + t_0) - x1) / t_1)) - 6.0)) + (12.0 * (x2 / x1)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= -0.3) tmp = t_3; elseif (x1 <= 30000.0) tmp = x1 + (t_2 + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2)))))); elseif (x1 <= 2.3e+132) tmp = t_3; else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.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[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(t$95$0 - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(t$95$2 + 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 * N[(N[(N[(N[(x2 * 2.0), $MachinePrecision] + t$95$0), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(12.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.3], t$95$3, If[LessEqual[x1, 30000.0], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(N[(N[(x2 * 2.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+132], t$95$3, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 3 \cdot \frac{\left(t_0 - x2 \cdot 2\right) - x1}{t_1}\\
t_3 := x1 + \left(t_2 + \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 \frac{\left(x2 \cdot 2 + t_0\right) - x1}{t_1} - 6\right) + 12 \cdot \frac{x2}{x1}\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -0.3:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x1 \leq 30000:\\
\;\;\;\;x1 + \left(t_2 + \left(x1 + 4 \cdot \left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+132}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.6%
if -5.60000000000000037e102 < x1 < -0.299999999999999989 or 3e4 < x1 < 2.3000000000000002e132Initial program 99.3%
Taylor expanded in x2 around inf 96.2%
associate-*r/96.2%
associate-/l*96.2%
+-commutative96.2%
unpow296.2%
fma-udef96.2%
Simplified96.2%
Taylor expanded in x1 around inf 96.3%
Taylor expanded in x1 around inf 83.3%
if -0.299999999999999989 < x1 < 3e4Initial program 98.7%
Taylor expanded in x1 around 0 82.9%
associate-*r*98.7%
sub-neg98.7%
distribute-lft-in98.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 2.3000000000000002e132 < x1 Initial program 6.9%
Taylor expanded in x1 around 0 6.9%
Taylor expanded in x1 around inf 58.7%
Final simplification74.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.6e+57)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (<= x1 2e+36)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* x2 2.0)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (+ (* (* x2 2.0) (* x1 x2)) (* -3.0 (* x1 x2)))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* x2 2.0) 3.0)))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.6e+57) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2e+36) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.6d+57)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if (x1 <= 2d+36) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (x2 * 2.0d0)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (((x2 * 2.0d0) * (x1 * x2)) + ((-3.0d0) * (x1 * x2))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.6e+57) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if (x1 <= 2e+36) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0)))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.6e+57: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif x1 <= 2e+36: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2)))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.6e+57) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif (x1 <= 2e+36) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(x2 * 2.0)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(Float64(Float64(x2 * 2.0) * Float64(x1 * x2)) + Float64(-3.0 * Float64(x1 * x2))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.6e+57) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif (x1 <= 2e+36) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (x2 * 2.0)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (((x2 * 2.0) * (x1 * x2)) + (-3.0 * (x1 * x2)))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((x2 * 2.0) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.6e+57], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+36], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(x2 * 2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(N[(N[(x2 * 2.0), $MachinePrecision] * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+57}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+36}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - x2 \cdot 2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(\left(x2 \cdot 2\right) \cdot \left(x1 \cdot x2\right) + -3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.60000000000000015e57Initial program 17.7%
Taylor expanded in x1 around 0 1.7%
Taylor expanded in x2 around 0 2.4%
*-commutative2.4%
associate-*l*2.4%
Simplified2.4%
Taylor expanded in x1 around 0 11.8%
if -1.60000000000000015e57 < x1 < 2.00000000000000008e36Initial program 98.7%
Taylor expanded in x1 around 0 74.6%
associate-*r*88.3%
sub-neg88.3%
distribute-lft-in88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if 2.00000000000000008e36 < x1 Initial program 45.7%
Taylor expanded in x1 around 0 8.2%
Taylor expanded in x1 around inf 38.2%
Final simplification60.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.2e+91)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))
(if (or (<= x1 -6.5e-160) (not (<= x1 5e-286)))
(+ (* x2 -6.0) (* x1 (+ (* 4.0 (* x2 (- (* x2 2.0) 3.0))) -1.0)))
(+ x1 (+ (* x2 -6.0) (* x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.2e+91) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if ((x1 <= -6.5e-160) || !(x1 <= 5e-286)) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.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.2d+91)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
else if ((x1 <= (-6.5d-160)) .or. (.not. (x1 <= 5d-286))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) + (-1.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.2e+91) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
} else if ((x1 <= -6.5e-160) || !(x1 <= 5e-286)) {
tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.2e+91: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) elif (x1 <= -6.5e-160) or not (x1 <= 5e-286): tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0)) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.2e+91) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); elseif ((x1 <= -6.5e-160) || !(x1 <= 5e-286)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) + -1.0))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.2e+91) tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); elseif ((x1 <= -6.5e-160) || ~((x1 <= 5e-286))) tmp = (x2 * -6.0) + (x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0)); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.2e+91], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -6.5e-160], N[Not[LessEqual[x1, 5e-286]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.2 \cdot 10^{+91}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq -6.5 \cdot 10^{-160} \lor \neg \left(x1 \leq 5 \cdot 10^{-286}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -3.19999999999999989e91Initial program 1.9%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 2.6%
*-commutative2.6%
associate-*l*2.6%
Simplified2.6%
Taylor expanded in x1 around 0 13.4%
if -3.19999999999999989e91 < x1 < -6.4999999999999996e-160 or 5.00000000000000037e-286 < x1 Initial program 83.4%
Taylor expanded in x1 around 0 52.3%
Taylor expanded in x1 around 0 60.7%
Taylor expanded in x1 around 0 60.7%
if -6.4999999999999996e-160 < x1 < 5.00000000000000037e-286Initial program 96.7%
Taylor expanded in x1 around 0 68.3%
Taylor expanded in x1 around 0 68.6%
Taylor expanded in x2 around 0 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification54.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -4e+223) (not (<= x2 1.4e+181))) (* x1 (+ (* 4.0 (* x2 (- (* x2 2.0) 3.0))) -1.0)) (+ x1 (+ (* x2 -6.0) (+ (* -12.0 (* x1 x2)) (* x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -4e+223) || !(x2 <= 1.4e+181)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + ((-12.0 * (x1 * x2)) + (x1 * -2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-4d+223)) .or. (.not. (x2 <= 1.4d+181))) then
tmp = x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) + (-1.0d0))
else
tmp = x1 + ((x2 * (-6.0d0)) + (((-12.0d0) * (x1 * x2)) + (x1 * (-2.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -4e+223) || !(x2 <= 1.4e+181)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + ((-12.0 * (x1 * x2)) + (x1 * -2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -4e+223) or not (x2 <= 1.4e+181): tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0) else: tmp = x1 + ((x2 * -6.0) + ((-12.0 * (x1 * x2)) + (x1 * -2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -4e+223) || !(x2 <= 1.4e+181)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) + -1.0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(Float64(-12.0 * Float64(x1 * x2)) + Float64(x1 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -4e+223) || ~((x2 <= 1.4e+181))) tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0); else tmp = x1 + ((x2 * -6.0) + ((-12.0 * (x1 * x2)) + (x1 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -4e+223], N[Not[LessEqual[x2, 1.4e+181]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(N[(-12.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -4 \cdot 10^{+223} \lor \neg \left(x2 \leq 1.4 \cdot 10^{+181}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + \left(-12 \cdot \left(x1 \cdot x2\right) + x1 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x2 < -4.00000000000000019e223 or 1.39999999999999992e181 < x2 Initial program 68.0%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 71.7%
Taylor expanded in x1 around inf 73.9%
if -4.00000000000000019e223 < x2 < 1.39999999999999992e181Initial program 68.9%
Taylor expanded in x1 around 0 42.5%
Taylor expanded in x1 around 0 45.2%
Taylor expanded in x2 around 0 46.5%
Final simplification51.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -8e+212) (not (<= x2 4.8e+172))) (* x1 (+ (* 4.0 (* x2 (- (* x2 2.0) 3.0))) -1.0)) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -8e+212) || !(x2 <= 4.8e+172)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-8d+212)) .or. (.not. (x2 <= 4.8d+172))) then
tmp = x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) + (-1.0d0))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -8e+212) || !(x2 <= 4.8e+172)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -8e+212) or not (x2 <= 4.8e+172): tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -8e+212) || !(x2 <= 4.8e+172)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) + -1.0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -8e+212) || ~((x2 <= 4.8e+172))) tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -8e+212], N[Not[LessEqual[x2, 4.8e+172]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -8 \cdot 10^{+212} \lor \neg \left(x2 \leq 4.8 \cdot 10^{+172}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x2 < -7.9999999999999993e212 or 4.8000000000000001e172 < x2 Initial program 68.0%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 71.7%
Taylor expanded in x1 around inf 73.9%
if -7.9999999999999993e212 < x2 < 4.8000000000000001e172Initial program 68.9%
Taylor expanded in x1 around 0 42.5%
Taylor expanded in x1 around 0 45.2%
Taylor expanded in x2 around 0 44.0%
*-commutative44.0%
Simplified44.0%
Final simplification49.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -7.5e+219) (not (<= x2 6.8e+177))) (* x1 (+ (* 4.0 (* x2 (- (* x2 2.0) 3.0))) -1.0)) (+ x1 (+ (* x2 -6.0) (* x1 (- (* x2 -12.0) 2.0))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.5e+219) || !(x2 <= 6.8e+177)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-7.5d+219)) .or. (.not. (x2 <= 6.8d+177))) then
tmp = x1 * ((4.0d0 * (x2 * ((x2 * 2.0d0) - 3.0d0))) + (-1.0d0))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x2 * (-12.0d0)) - 2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.5e+219) || !(x2 <= 6.8e+177)) {
tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0);
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -7.5e+219) or not (x2 <= 6.8e+177): tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0) else: tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -7.5e+219) || !(x2 <= 6.8e+177)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(x2 * 2.0) - 3.0))) + -1.0)); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * -12.0) - 2.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -7.5e+219) || ~((x2 <= 6.8e+177))) tmp = x1 * ((4.0 * (x2 * ((x2 * 2.0) - 3.0))) + -1.0); else tmp = x1 + ((x2 * -6.0) + (x1 * ((x2 * -12.0) - 2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -7.5e+219], N[Not[LessEqual[x2, 6.8e+177]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(x2 * 2.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.5 \cdot 10^{+219} \lor \neg \left(x2 \leq 6.8 \cdot 10^{+177}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(x2 \cdot 2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x2 \cdot -12 - 2\right)\right)\\
\end{array}
\end{array}
if x2 < -7.5000000000000006e219 or 6.7999999999999996e177 < x2 Initial program 68.0%
Taylor expanded in x1 around 0 50.4%
Taylor expanded in x1 around 0 71.7%
Taylor expanded in x1 around inf 73.9%
if -7.5000000000000006e219 < x2 < 6.7999999999999996e177Initial program 68.9%
Taylor expanded in x1 around 0 42.5%
Taylor expanded in x2 around 0 42.7%
*-commutative42.7%
associate-*l*42.7%
Simplified42.7%
Taylor expanded in x1 around 0 46.5%
Final simplification51.5%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.36) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (+ x1 (+ 9.0 (* x1 (+ 1.0 (* x2 -12.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.36) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1.36d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 + (9.0d0 + (x1 * (1.0d0 + (x2 * (-12.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.36) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.36: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.36) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(9.0 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.36) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x1 + (9.0 + (x1 * (1.0 + (x2 * -12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(9.0 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.36:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(9 + x1 \cdot \left(1 + x2 \cdot -12\right)\right)\\
\end{array}
\end{array}
if x1 < 1.3600000000000001Initial program 73.5%
Taylor expanded in x1 around 0 52.4%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x2 around 0 48.6%
*-commutative48.6%
Simplified48.6%
if 1.3600000000000001 < x1 Initial program 52.3%
Taylor expanded in x1 around 0 14.6%
Taylor expanded in x2 around 0 5.2%
*-commutative5.2%
associate-*l*5.2%
Simplified5.2%
Taylor expanded in x1 around inf 17.5%
*-commutative17.5%
Simplified17.5%
Final simplification41.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x2 -1.7e+240)
(+ x1 (* x1 (+ 1.0 (* x2 -12.0))))
(if (<= x2 -6.3e-83)
(* x2 -6.0)
(if (<= x2 9.5e-164) (- x1) (+ x1 (* x2 -6.0))))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -1.7e+240) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else if (x2 <= -6.3e-83) {
tmp = x2 * -6.0;
} else if (x2 <= 9.5e-164) {
tmp = -x1;
} else {
tmp = x1 + (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 (x2 <= (-1.7d+240)) then
tmp = x1 + (x1 * (1.0d0 + (x2 * (-12.0d0))))
else if (x2 <= (-6.3d-83)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 9.5d-164) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -1.7e+240) {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
} else if (x2 <= -6.3e-83) {
tmp = x2 * -6.0;
} else if (x2 <= 9.5e-164) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -1.7e+240: tmp = x1 + (x1 * (1.0 + (x2 * -12.0))) elif x2 <= -6.3e-83: tmp = x2 * -6.0 elif x2 <= 9.5e-164: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -1.7e+240) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0)))); elseif (x2 <= -6.3e-83) tmp = Float64(x2 * -6.0); elseif (x2 <= 9.5e-164) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -1.7e+240) tmp = x1 + (x1 * (1.0 + (x2 * -12.0))); elseif (x2 <= -6.3e-83) tmp = x2 * -6.0; elseif (x2 <= 9.5e-164) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -1.7e+240], N[(x1 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, -6.3e-83], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 9.5e-164], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.7 \cdot 10^{+240}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\
\mathbf{elif}\;x2 \leq -6.3 \cdot 10^{-83}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 9.5 \cdot 10^{-164}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -1.70000000000000004e240Initial program 61.1%
Taylor expanded in x1 around 0 56.0%
Taylor expanded in x2 around 0 17.2%
*-commutative17.2%
associate-*l*17.2%
Simplified17.2%
Taylor expanded in x1 around inf 41.1%
*-commutative41.1%
Simplified41.1%
if -1.70000000000000004e240 < x2 < -6.29999999999999967e-83Initial program 70.5%
Taylor expanded in x1 around 0 44.1%
Taylor expanded in x1 around 0 43.1%
*-commutative43.1%
Simplified43.1%
Taylor expanded in x1 around 0 44.0%
*-commutative44.0%
Simplified44.0%
if -6.29999999999999967e-83 < x2 < 9.5000000000000001e-164Initial program 64.1%
Taylor expanded in x1 around 0 38.2%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x2 around 0 32.1%
distribute-rgt1-in32.1%
metadata-eval32.1%
*-commutative32.1%
Simplified32.1%
if 9.5000000000000001e-164 < x2 Initial program 73.6%
Taylor expanded in x1 around 0 47.0%
Taylor expanded in x1 around 0 32.1%
*-commutative32.1%
Simplified32.1%
Final simplification35.8%
(FPCore (x1 x2) :precision binary64 (if (<= x1 1.36) (+ x1 (+ (* x2 -6.0) (* x1 -2.0))) (+ x1 (* x1 (+ 1.0 (* x2 -12.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 1.36) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 1.36d0) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else
tmp = x1 + (x1 * (1.0d0 + (x2 * (-12.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 1.36) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else {
tmp = x1 + (x1 * (1.0 + (x2 * -12.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 1.36: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) else: tmp = x1 + (x1 * (1.0 + (x2 * -12.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 1.36) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(x2 * -12.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 1.36) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); else tmp = x1 + (x1 * (1.0 + (x2 * -12.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 1.36], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 1.36:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + x2 \cdot -12\right)\\
\end{array}
\end{array}
if x1 < 1.3600000000000001Initial program 73.5%
Taylor expanded in x1 around 0 52.4%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x2 around 0 48.6%
*-commutative48.6%
Simplified48.6%
if 1.3600000000000001 < x1 Initial program 52.3%
Taylor expanded in x1 around 0 14.6%
Taylor expanded in x2 around 0 5.2%
*-commutative5.2%
associate-*l*5.2%
Simplified5.2%
Taylor expanded in x1 around inf 17.5%
*-commutative17.5%
Simplified17.5%
Final simplification41.7%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -6.3e-83) (* x2 -6.0) (if (<= x2 2.9e-162) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -6.3e-83) {
tmp = x2 * -6.0;
} else if (x2 <= 2.9e-162) {
tmp = -x1;
} else {
tmp = x1 + (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 (x2 <= (-6.3d-83)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 2.9d-162) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -6.3e-83) {
tmp = x2 * -6.0;
} else if (x2 <= 2.9e-162) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -6.3e-83: tmp = x2 * -6.0 elif x2 <= 2.9e-162: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -6.3e-83) tmp = Float64(x2 * -6.0); elseif (x2 <= 2.9e-162) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -6.3e-83) tmp = x2 * -6.0; elseif (x2 <= 2.9e-162) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -6.3e-83], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 2.9e-162], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.3 \cdot 10^{-83}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 2.9 \cdot 10^{-162}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -6.29999999999999967e-83Initial program 68.5%
Taylor expanded in x1 around 0 46.7%
Taylor expanded in x1 around 0 35.7%
*-commutative35.7%
Simplified35.7%
Taylor expanded in x1 around 0 36.5%
*-commutative36.5%
Simplified36.5%
if -6.29999999999999967e-83 < x2 < 2.9000000000000001e-162Initial program 64.1%
Taylor expanded in x1 around 0 38.2%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x2 around 0 32.1%
distribute-rgt1-in32.1%
metadata-eval32.1%
*-commutative32.1%
Simplified32.1%
if 2.9000000000000001e-162 < x2 Initial program 73.6%
Taylor expanded in x1 around 0 47.0%
Taylor expanded in x1 around 0 32.1%
*-commutative32.1%
Simplified32.1%
Final simplification33.5%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.05e-82) (not (<= x2 3.5e-164))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.05e-82) || !(x2 <= 3.5e-164)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.05d-82)) .or. (.not. (x2 <= 3.5d-164))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.05e-82) || !(x2 <= 3.5e-164)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.05e-82) or not (x2 <= 3.5e-164): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.05e-82) || !(x2 <= 3.5e-164)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.05e-82) || ~((x2 <= 3.5e-164))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.05e-82], N[Not[LessEqual[x2, 3.5e-164]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.05 \cdot 10^{-82} \lor \neg \left(x2 \leq 3.5 \cdot 10^{-164}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -1.05e-82 or 3.5e-164 < x2 Initial program 71.1%
Taylor expanded in x1 around 0 46.9%
Taylor expanded in x1 around 0 33.8%
*-commutative33.8%
Simplified33.8%
Taylor expanded in x1 around 0 33.9%
*-commutative33.9%
Simplified33.9%
if -1.05e-82 < x2 < 3.5e-164Initial program 64.1%
Taylor expanded in x1 around 0 38.2%
Taylor expanded in x1 around 0 39.8%
Taylor expanded in x2 around 0 32.1%
distribute-rgt1-in32.1%
metadata-eval32.1%
*-commutative32.1%
Simplified32.1%
Final simplification33.3%
(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 Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 68.8%
Taylor expanded in x1 around 0 44.0%
Taylor expanded in x1 around 0 50.1%
Taylor expanded in x2 around 0 13.6%
distribute-rgt1-in13.6%
metadata-eval13.6%
*-commutative13.6%
Simplified13.6%
Final simplification13.6%
(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.8%
Taylor expanded in x1 around 0 44.0%
Taylor expanded in x1 around 0 25.5%
*-commutative25.5%
Simplified25.5%
Taylor expanded in x1 around inf 3.0%
Final simplification3.0%
herbie shell --seed 2023305
(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))))))