
(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 21 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 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (/ (fma x1 (* x1 3.0) (- (* 2.0 x2) x1)) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_3 4.0 -6.0)) (* t_3 (* (* x1 2.0) (+ t_3 -3.0))))
(fma t_0 t_3 (pow x1 3.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = fma(x1, (x1 * 3.0), ((2.0 * x2) - x1)) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_3, 4.0, -6.0)), (t_3 * ((x1 * 2.0) * (t_3 + -3.0)))), fma(t_0, t_3, pow(x1, 3.0)))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(fma(x1, Float64(x1 * 3.0), Float64(Float64(2.0 * x2) - x1)) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_3, 4.0, -6.0)), Float64(t_3 * Float64(Float64(x1 * 2.0) * Float64(t_3 + -3.0)))), fma(t_0, t_3, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(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] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$3 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$3 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2 - x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\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 \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t_3, 4, -6\right), t_3 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(t_3 + -3\right)\right)\right), \mathsf{fma}\left(t_0, t_3, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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%
Simplified99.6%
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%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 98.4%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * pow(x1, 4.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 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (6.0 * math.pow(x1, 4.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(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.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 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (6.0 * (x1 ^ 4.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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(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] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(6.0 * N[Power[x1, 4.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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_3 := x1 + \left(\left(x1 + \left(\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 \left(t_2 \cdot 4 - 6\right)\right) + t_0 \cdot t_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\right)\\
\mathbf{if}\;t_3 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\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%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 98.4%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.6e+102) (not (<= x1 1.7e+62)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.6e+102) || !(x1 <= 1.7e+62)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * 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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5.6d+102)) .or. (.not. (x1 <= 1.7d+62))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
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 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.6e+102) || !(x1 <= 1.7e+62)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5.6e+102) or not (x1 <= 1.7e+62): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_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(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.6e+102) || !(x1 <= 1.7e+62)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_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 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.6e+102) || ~((x1 <= 1.7e+62))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.6e+102], N[Not[LessEqual[x1, 1.7e+62]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(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] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.7 \cdot 10^{+62}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(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 \left(t_2 \cdot 4 - 6\right)\right) + 3 \cdot t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 1.70000000000000007e62 < x1 Initial program 25.5%
Taylor expanded in x1 around 0 23.2%
*-commutative23.2%
fma-def23.2%
+-commutative23.2%
mul-1-neg23.2%
unsub-neg23.2%
+-commutative23.2%
unpow323.2%
unpow223.2%
distribute-lft-out24.3%
unpow224.3%
*-commutative24.3%
Simplified24.3%
Taylor expanded in x1 around inf 98.8%
if -5.60000000000000037e102 < x1 < 1.70000000000000007e62Initial program 99.4%
Taylor expanded in x1 around inf 98.9%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -1.65e+102) (not (<= x1 1.7e+62)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 (+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0)))
(* t_0 (- (* 2.0 x2) x1))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.65e+102) || !(x1 <= 1.7e+62)) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
}
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 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-1.65d+102)) .or. (.not. (x1 <= 1.7d+62))) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + (t_0 * ((2.0d0 * x2) - x1))))))
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 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -1.65e+102) || !(x1 <= 1.7e+62)) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -1.65e+102) or not (x1 <= 1.7e+62): tmp = x1 + (6.0 * math.pow(x1, 4.0)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))) 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(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -1.65e+102) || !(x1 <= 1.7e+62)) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -1.65e+102) || ~((x1 <= 1.7e+62))) tmp = x1 + (6.0 * (x1 ^ 4.0)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))); 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -1.65e+102], N[Not[LessEqual[x1, 1.7e+62]], $MachinePrecision]], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(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[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $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(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -1.65 \cdot 10^{+102} \lor \neg \left(x1 \leq 1.7 \cdot 10^{+62}\right):\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(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) + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.64999999999999999e102 or 1.70000000000000007e62 < x1 Initial program 25.5%
Taylor expanded in x1 around 0 23.2%
*-commutative23.2%
fma-def23.2%
+-commutative23.2%
mul-1-neg23.2%
unsub-neg23.2%
+-commutative23.2%
unpow323.2%
unpow223.2%
distribute-lft-out24.3%
unpow224.3%
*-commutative24.3%
Simplified24.3%
Taylor expanded in x1 around inf 98.8%
if -1.64999999999999999e102 < x1 < 1.70000000000000007e62Initial program 99.4%
Taylor expanded in x1 around 0 97.0%
Taylor expanded in x1 around inf 96.6%
Final simplification97.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0))))
(if (<= x1 -5.6e+102)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 520000.0)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(* t_1 (+ t_5 (* (* (* x1 2.0) t_4) (- (+ x2 x2) 3.0))))
(* t_0 (+ x2 x2)))))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_3
(+ x1 (+ t_2 (+ (* t_0 t_4) (* t_1 (+ t_5 (/ x2 (/ x1 12.0)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 = x1 * (x1 * x1);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 520000.0) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * (t_5 + (((x1 * 2.0) * t_4) * ((x2 + x2) - 3.0)))) + (t_0 * (x2 + x2))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (t_5 + (x2 / (x1 / 12.0))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_5 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= 520000.0d0) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * (t_5 + (((x1 * 2.0d0) * t_4) * ((x2 + x2) - 3.0d0)))) + (t_0 * (x2 + x2))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (t_5 + (x2 / (x1 / 12.0d0))))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 520000.0) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * (t_5 + (((x1 * 2.0) * t_4) * ((x2 + x2) - 3.0)))) + (t_0 * (x2 + x2))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (t_5 + (x2 / (x1 / 12.0))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= 520000.0: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * (t_5 + (((x1 * 2.0) * t_4) * ((x2 + x2) - 3.0)))) + (t_0 * (x2 + x2)))))) elif x1 <= 1.35e+154: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (t_5 + (x2 / (x1 / 12.0)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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(x1 * Float64(x1 * x1)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_5 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= 520000.0) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_1 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(Float64(x2 + x2) - 3.0)))) + Float64(t_0 * Float64(x2 + x2))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * t_4) + Float64(t_1 * Float64(t_5 + Float64(x2 / Float64(x1 / 12.0))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.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 = x1 * (x1 * x1); t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_5 = (x1 * x1) * ((t_4 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= 520000.0) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * (t_5 + (((x1 * 2.0) * t_4) * ((x2 + x2) - 3.0)))) + (t_0 * (x2 + x2)))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (t_5 + (x2 / (x1 / 12.0)))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 520000.0], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$1 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(t$95$5 + N[(x2 / N[(x1 / 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 520000:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_2 + \left(t_1 \cdot \left(t_5 + \left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(\left(x2 + x2\right) - 3\right)\right) + t_0 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_2 + \left(t_0 \cdot t_4 + t_1 \cdot \left(t_5 + \frac{x2}{\frac{x1}{12}}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < 5.2e5Initial program 99.4%
Taylor expanded in x1 around 0 95.9%
count-295.9%
Simplified95.9%
Taylor expanded in x1 around 0 95.9%
count-295.9%
Simplified95.9%
if 5.2e5 < x1 < 1.35000000000000003e154Initial program 96.6%
Taylor expanded in x2 around inf 96.7%
associate-*r/96.7%
associate-/l*96.7%
+-commutative96.7%
unpow296.7%
fma-udef96.7%
Simplified96.7%
Taylor expanded in x1 around inf 91.3%
associate-*r/91.3%
*-commutative91.3%
associate-/l*91.3%
Simplified91.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification86.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_4 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.6e+102)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 2.3e+38)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(* t_1 (+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* (* x1 x1) 6.0)))
(* t_0 (- (* 2.0 x2) x1)))))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_3
(+
x1
(+
t_2
(+
(* t_0 t_4)
(*
t_1
(+ (* (* x1 x1) (- (* t_4 4.0) 6.0)) (/ x2 (/ x1 12.0)))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 = x1 * (x1 * x1);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 2.3e+38) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (x2 / (x1 / 12.0))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_4 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= 2.3d+38) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0))) + (t_0 * ((2.0d0 * x2) - x1))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (x2 / (x1 / 12.0d0))))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 2.3e+38) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (x2 / (x1 / 12.0))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= 2.3e+38: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))) elif x1 <= 1.35e+154: tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (x2 / (x1 / 12.0)))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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(x1 * Float64(x1 * x1)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= 2.3e+38) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0))) + Float64(t_0 * Float64(Float64(2.0 * x2) - x1))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * t_4) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(x2 / Float64(x1 / 12.0))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.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 = x1 * (x1 * x1); t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_4 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= 2.3e+38) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_1 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))) + (t_0 * ((2.0 * x2) - x1)))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_3 + (x1 + (t_2 + ((t_0 * t_4) + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (x2 / (x1 / 12.0)))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.3e+38], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * t$95$4), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(x2 / N[(x1 / 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.3 \cdot 10^{+38}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_2 + \left(t_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t_4\right) \cdot \left(t_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) + t_0 \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_3 + \left(x1 + \left(t_2 + \left(t_0 \cdot t_4 + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t_4 \cdot 4 - 6\right) + \frac{x2}{\frac{x1}{12}}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < 2.3000000000000001e38Initial program 99.4%
Taylor expanded in x1 around 0 97.3%
Taylor expanded in x1 around inf 96.9%
if 2.3000000000000001e38 < x1 < 1.35000000000000003e154Initial program 95.8%
Taylor expanded in x2 around inf 95.8%
associate-*r/95.8%
associate-/l*95.8%
+-commutative95.8%
unpow295.8%
fma-udef95.8%
Simplified95.8%
Taylor expanded in x1 around inf 95.8%
associate-*r/95.8%
*-commutative95.8%
associate-/l*95.8%
Simplified95.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification88.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_4 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_5 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))
(if (<= x1 -5.6e+102)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 -1.56e+22)
(+
x1
(+
t_5
(+ x1 (+ t_2 (+ (* t_0 t_3) (* t_1 (+ t_4 (/ x2 (/ x1 12.0)))))))))
(if (<= x1 1.35e+154)
(+
x1
(+
t_5
(+
x1
(+
t_2
(+
(* t_0 (+ x2 x2))
(*
t_1
(+ t_4 (* (- (+ x2 x2) 3.0) (* (* x1 2.0) (+ x2 x2))))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 = x1 * (x1 * x1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -1.56e+22) {
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * t_3) + (t_1 * (t_4 + (x2 / (x1 / 12.0))))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * (x2 + x2)) + (t_1 * (t_4 + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_4 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_5 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= (-1.56d+22)) then
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * t_3) + (t_1 * (t_4 + (x2 / (x1 / 12.0d0))))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * (x2 + x2)) + (t_1 * (t_4 + (((x2 + x2) - 3.0d0) * ((x1 * 2.0d0) * (x2 + x2)))))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -1.56e+22) {
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * t_3) + (t_1 * (t_4 + (x2 / (x1 / 12.0))))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * (x2 + x2)) + (t_1 * (t_4 + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_5 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= -1.56e+22: tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * t_3) + (t_1 * (t_4 + (x2 / (x1 / 12.0)))))))) elif x1 <= 1.35e+154: tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * (x2 + x2)) + (t_1 * (t_4 + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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(x1 * Float64(x1 * x1)) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_5 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= -1.56e+22) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * t_3) + Float64(t_1 * Float64(t_4 + Float64(x2 / Float64(x1 / 12.0))))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_2 + Float64(Float64(t_0 * Float64(x2 + x2)) + Float64(t_1 * Float64(t_4 + Float64(Float64(Float64(x2 + x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x2 + x2)))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.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 = x1 * (x1 * x1); t_3 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_5 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= -1.56e+22) tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * t_3) + (t_1 * (t_4 + (x2 / (x1 / 12.0)))))))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_5 + (x1 + (t_2 + ((t_0 * (x2 + x2)) + (t_1 * (t_4 + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.56e+22], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * t$95$3), $MachinePrecision] + N[(t$95$1 * N[(t$95$4 + N[(x2 / N[(x1 / 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$2 + N[(N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(t$95$4 + N[(N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t_3 \cdot 4 - 6\right)\\
t_5 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.56 \cdot 10^{+22}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_2 + \left(t_0 \cdot t_3 + t_1 \cdot \left(t_4 + \frac{x2}{\frac{x1}{12}}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t_5 + \left(x1 + \left(t_2 + \left(t_0 \cdot \left(x2 + x2\right) + t_1 \cdot \left(t_4 + \left(\left(x2 + x2\right) - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < -1.56e22Initial program 99.7%
Taylor expanded in x2 around inf 99.7%
associate-*r/99.7%
associate-/l*99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in x1 around inf 91.3%
associate-*r/91.3%
*-commutative91.3%
associate-/l*91.3%
Simplified91.3%
if -1.56e22 < x1 < 1.35000000000000003e154Initial program 98.8%
Taylor expanded in x1 around 0 95.2%
count-295.2%
Simplified95.2%
Taylor expanded in x1 around 0 94.6%
count-295.2%
Simplified94.6%
Taylor expanded in x1 around 0 94.6%
count-295.2%
Simplified94.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification86.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (<= x1 -5.6e+102)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (+ x2 x2))
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
(* (- (+ x2 x2) 3.0) (* (* x1 2.0) (+ x2 x2))))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + (((x2 + x2) - 3.0d0) * ((x1 * 2.0d0) * (x2 + x2)))))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(x2 + x2)) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + Float64(Float64(Float64(x2 + x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x2 + x2)))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(x2 + x2\right) + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1} \cdot 4 - 6\right) + \left(\left(x2 + x2\right) - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around 0 93.4%
count-293.4%
Simplified93.4%
Taylor expanded in x1 around 0 92.8%
count-293.4%
Simplified92.8%
Taylor expanded in x1 around 0 91.1%
count-293.4%
Simplified91.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification84.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 6.0)))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_4 (+ x1 (+ t_3 (+ x1 (* 4.0 (* x1 (* x2 (+ x2 x2))))))))
(t_5
(+
x1
(+
t_3
(+
x1
(+
(* x1 (* x1 x1))
(+ (* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)) (* t_1 t_2))))))))
(if (<= x1 -5.6e+102)
(+
x1
(+ (+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0))))) (* x2 (+ -6.0 t_2))))
(if (<= x1 -140000.0)
t_5
(if (<= x1 -3.5e-256)
t_4
(if (<= x1 2e-171)
(+
x1
(+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 235.0)
t_4
(if (<= x1 1.35e+154)
t_5
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 = x1 * (x1 * 6.0);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * (x2 * (x2 + x2))))));
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * t_2)))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + t_2)));
} else if (x1 <= -140000.0) {
tmp = t_5;
} else if (x1 <= -3.5e-256) {
tmp = t_4;
} else if (x1 <= 2e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 235.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * 6.0d0)
t_3 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_4 = x1 + (t_3 + (x1 + (4.0d0 * (x1 * (x2 * (x2 + x2))))))
t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) + (t_1 * t_2)))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + t_2)))
else if (x1 <= (-140000.0d0)) then
tmp = t_5
else if (x1 <= (-3.5d-256)) then
tmp = t_4
else if (x1 <= 2d-171) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 235.0d0) then
tmp = t_4
else if (x1 <= 1.35d+154) then
tmp = t_5
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * 6.0);
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * (x2 * (x2 + x2))))));
double t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * t_2)))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + t_2)));
} else if (x1 <= -140000.0) {
tmp = t_5;
} else if (x1 <= -3.5e-256) {
tmp = t_4;
} else if (x1 <= 2e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 235.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * 6.0) t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * (x2 * (x2 + x2)))))) t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * t_2))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + t_2))) elif x1 <= -140000.0: tmp = t_5 elif x1 <= -3.5e-256: tmp = t_4 elif x1 <= 2e-171: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 235.0: tmp = t_4 elif x1 <= 1.35e+154: tmp = t_5 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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(x1 * Float64(x1 * 6.0)) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_4 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(x2 + x2))))))) t_5 = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(t_1 * t_2)))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + t_2)))); elseif (x1 <= -140000.0) tmp = t_5; elseif (x1 <= -3.5e-256) tmp = t_4; elseif (x1 <= 2e-171) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 235.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.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 = x1 * (x1 * 6.0); t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_4 = x1 + (t_3 + (x1 + (4.0 * (x1 * (x2 * (x2 + x2)))))); t_5 = x1 + (t_3 + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * t_2))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + t_2))); elseif (x1 <= -140000.0) tmp = t_5; elseif (x1 <= -3.5e-256) tmp = t_4; elseif (x1 <= 2e-171) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 235.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(t$95$3 + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$3 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -140000.0], t$95$5, If[LessEqual[x1, -3.5e-256], t$95$4, If[LessEqual[x1, 2e-171], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 235.0], t$95$4, If[LessEqual[x1, 1.35e+154], t$95$5, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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 := x1 \cdot \left(x1 \cdot 6\right)\\
t_3 := 3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1}\\
t_4 := x1 + \left(t_3 + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\
t_5 := x1 + \left(t_3 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \frac{\left(t_0 + 2 \cdot x2\right) - x1}{t_1} + t_1 \cdot t_2\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + t_2\right)\right)\\
\mathbf{elif}\;x1 \leq -140000:\\
\;\;\;\;t_5\\
\mathbf{elif}\;x1 \leq -3.5 \cdot 10^{-256}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-171}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 235:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < -1.4e5 or 235 < x1 < 1.35000000000000003e154Initial program 97.9%
Taylor expanded in x1 around 0 81.0%
count-281.0%
Simplified81.0%
Taylor expanded in x1 around inf 74.6%
*-commutative74.6%
unpow274.6%
associate-*l*74.7%
Simplified74.7%
if -1.4e5 < x1 < -3.50000000000000014e-256 or 2e-171 < x1 < 235Initial program 99.3%
Taylor expanded in x1 around 0 89.6%
Taylor expanded in x2 around inf 89.6%
*-commutative89.6%
associate-*l*89.6%
unpow289.6%
associate-*l*89.6%
*-commutative89.6%
count-289.6%
Simplified89.6%
if -3.50000000000000014e-256 < x1 < 2e-171Initial program 99.7%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x1 around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
Simplified97.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification80.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (<= x1 -5.6e+102)
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (+ x2 x2))
(*
t_1
(+
(* (* x1 x1) 6.0)
(* (- (+ x2 x2) 3.0) (* (* x1 2.0) (+ x2 x2))))))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- 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 tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * 6.0) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
if (x1 <= (-5.6d+102)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * 6.0d0) + (((x2 + x2) - 3.0d0) * ((x1 * 2.0d0) * (x2 + x2)))))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * 6.0) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2)))))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * 6.0) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(x2 + x2)) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * 6.0) + Float64(Float64(Float64(x2 + x2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x2 + x2)))))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (x2 + x2)) + (t_1 * (((x1 * x1) * 6.0) + (((x2 + x2) - 3.0) * ((x1 * 2.0) * (x2 + x2))))))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision] + N[(N[(N[(x2 + x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.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\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t_0 - 2 \cdot x2\right) - x1}{t_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t_0 \cdot \left(x2 + x2\right) + t_1 \cdot \left(\left(x1 \cdot x1\right) \cdot 6 + \left(\left(x2 + x2\right) - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x2 + x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 28.1%
associate-*r*28.1%
distribute-rgt-out28.1%
*-commutative28.1%
unpow228.1%
associate-*l*28.1%
Simplified28.1%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 98.9%
Taylor expanded in x1 around 0 93.4%
count-293.4%
Simplified93.4%
Taylor expanded in x1 around 0 92.8%
count-293.4%
Simplified92.8%
Taylor expanded in x1 around 0 91.1%
count-293.4%
Simplified91.1%
Taylor expanded in x1 around inf 90.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification83.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0))) (t_1 (* 4.0 (* x1 t_0))))
(if (<= x1 -1.45e+160)
(+ x1 (+ (+ x1 t_1) (* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 -3.2e-256)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_0) 2.0))))
(if (<= x1 4e-171)
(+
x1
(+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 1.35e+154)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) t_1))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = 4.0 * (x1 * t_0);
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + t_1) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -3.2e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
} else if (x1 <= 4e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + t_1)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = 4.0d0 * (x1 * t_0)
if (x1 <= (-1.45d+160)) then
tmp = x1 + ((x1 + t_1) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= (-3.2d-256)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_0) - 2.0d0)))
else if (x1 <= 4d-171) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + ((x1 * (x1 * x1)) + t_1)))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = 4.0 * (x1 * t_0);
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + t_1) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -3.2e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
} else if (x1 <= 4e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + t_1)));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = 4.0 * (x1 * t_0) tmp = 0 if x1 <= -1.45e+160: tmp = x1 + ((x1 + t_1) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= -3.2e-256: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))) elif x1 <= 4e-171: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + t_1))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(4.0 * Float64(x1 * t_0)) tmp = 0.0 if (x1 <= -1.45e+160) tmp = Float64(x1 + Float64(Float64(x1 + t_1) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= -3.2e-256) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_0) - 2.0)))); elseif (x1 <= 4e-171) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + t_1)))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = 4.0 * (x1 * t_0); tmp = 0.0; if (x1 <= -1.45e+160) tmp = x1 + ((x1 + t_1) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= -3.2e-256) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))); elseif (x1 <= 4e-171) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + t_1))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.45e+160], N[(x1 + N[(N[(x1 + t$95$1), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.2e-256], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e-171], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := 4 \cdot \left(x1 \cdot t_0\right)\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+160}:\\
\;\;\;\;x1 + \left(\left(x1 + t_1\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-256}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_0 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{-171}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + t_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.45e160Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 47.1%
associate-*r*47.1%
distribute-rgt-out47.1%
*-commutative47.1%
unpow247.1%
associate-*l*47.1%
Simplified47.1%
if -1.45e160 < x1 < -3.1999999999999999e-256Initial program 86.8%
Taylor expanded in x1 around 0 84.1%
*-commutative84.1%
fma-def84.1%
+-commutative84.1%
mul-1-neg84.1%
unsub-neg84.1%
+-commutative84.1%
unpow384.1%
unpow284.1%
distribute-lft-out84.1%
unpow284.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in x1 around 0 61.0%
if -3.1999999999999999e-256 < x1 < 3.9999999999999999e-171Initial program 99.7%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x1 around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
Simplified97.1%
if 3.9999999999999999e-171 < x1 < 1.35000000000000003e154Initial program 98.0%
Taylor expanded in x1 around 0 91.0%
count-291.0%
Simplified91.0%
Taylor expanded in x1 around 0 89.6%
count-291.0%
Simplified89.6%
Taylor expanded in x1 around 0 89.8%
count-291.0%
Simplified89.8%
Taylor expanded in x1 around 0 68.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification71.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0))))
(if (<= x1 -1.45e+160)
(+ x1 (+ (+ x1 (* 4.0 (* x1 t_0))) (* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 -1.6e-256)
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_0) 2.0))))
(if (<= x1 1.45e-171)
(+
x1
(+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 1.35e+154)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (* 4.0 (* x1 (* x2 (+ x2 x2)))))))
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -1.6e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
} else if (x1 <= 1.45e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * (x2 + x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
if (x1 <= (-1.45d+160)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_0))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= (-1.6d-256)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_0) - 2.0d0)))
else if (x1 <= 1.45d-171) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + (4.0d0 * (x1 * (x2 * (x2 + x2))))))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -1.6e-256) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
} else if (x1 <= 1.45e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * (x2 + x2))))));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) tmp = 0 if x1 <= -1.45e+160: tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= -1.6e-256: tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))) elif x1 <= 1.45e-171: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * (x2 + x2)))))) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) tmp = 0.0 if (x1 <= -1.45e+160) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_0))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= -1.6e-256) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_0) - 2.0)))); elseif (x1 <= 1.45e-171) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(x2 + x2))))))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); tmp = 0.0; if (x1 <= -1.45e+160) tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= -1.6e-256) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))); elseif (x1 <= 1.45e-171) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + (4.0 * (x1 * (x2 * (x2 + x2)))))); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.45e+160], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.6e-256], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.45e-171], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(x2 + x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+160}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.6 \cdot 10^{-256}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_0 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.45 \cdot 10^{-171}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(x2 + x2\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.45e160Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 47.1%
associate-*r*47.1%
distribute-rgt-out47.1%
*-commutative47.1%
unpow247.1%
associate-*l*47.1%
Simplified47.1%
if -1.45e160 < x1 < -1.6e-256Initial program 86.8%
Taylor expanded in x1 around 0 84.1%
*-commutative84.1%
fma-def84.1%
+-commutative84.1%
mul-1-neg84.1%
unsub-neg84.1%
+-commutative84.1%
unpow384.1%
unpow284.1%
distribute-lft-out84.1%
unpow284.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in x1 around 0 61.0%
if -1.6e-256 < x1 < 1.4499999999999999e-171Initial program 99.7%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x1 around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
Simplified97.1%
if 1.4499999999999999e-171 < x1 < 1.35000000000000003e154Initial program 98.0%
Taylor expanded in x1 around 0 58.1%
Taylor expanded in x2 around inf 58.1%
*-commutative58.1%
associate-*l*58.1%
unpow258.1%
associate-*l*58.1%
*-commutative58.1%
count-258.1%
Simplified58.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
fma-def0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
+-commutative0.0%
unpow30.0%
unpow20.0%
distribute-lft-out0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 7.2%
flip-+91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
Applied egg-rr91.2%
swap-sqr91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification68.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 t_0) 2.0))))))
(if (<= x1 -1.45e+160)
(+ x1 (+ (+ x1 (* 4.0 (* x1 t_0))) (* x2 (+ -6.0 (* x1 (* x1 6.0))))))
(if (<= x1 -3.2e-256)
t_1
(if (<= x1 5.5e-170)
(+
x1
(+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 4.8e+146)
t_1
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -3.2e-256) {
tmp = t_1;
} else if (x1 <= 5.5e-170) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 4.8e+146) {
tmp = t_1;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * t_0) - 2.0d0)))
if (x1 <= (-1.45d+160)) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * t_0))) + (x2 * ((-6.0d0) + (x1 * (x1 * 6.0d0)))))
else if (x1 <= (-3.2d-256)) then
tmp = t_1
else if (x1 <= 5.5d-170) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 4.8d+146) then
tmp = t_1
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0)));
double tmp;
if (x1 <= -1.45e+160) {
tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0)))));
} else if (x1 <= -3.2e-256) {
tmp = t_1;
} else if (x1 <= 5.5e-170) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 4.8e+146) {
tmp = t_1;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))) tmp = 0 if x1 <= -1.45e+160: tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))) elif x1 <= -3.2e-256: tmp = t_1 elif x1 <= 5.5e-170: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 4.8e+146: tmp = t_1 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * t_0) - 2.0)))) tmp = 0.0 if (x1 <= -1.45e+160) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * t_0))) + Float64(x2 * Float64(-6.0 + Float64(x1 * Float64(x1 * 6.0)))))); elseif (x1 <= -3.2e-256) tmp = t_1; elseif (x1 <= 5.5e-170) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 4.8e+146) tmp = t_1; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * t_0) - 2.0))); tmp = 0.0; if (x1 <= -1.45e+160) tmp = x1 + ((x1 + (4.0 * (x1 * t_0))) + (x2 * (-6.0 + (x1 * (x1 * 6.0))))); elseif (x1 <= -3.2e-256) tmp = t_1; elseif (x1 <= 5.5e-170) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 4.8e+146) tmp = t_1; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * t$95$0), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.45e+160], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * N[(-6.0 + N[(x1 * N[(x1 * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.2e-256], t$95$1, If[LessEqual[x1, 5.5e-170], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e+146], t$95$1, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot t_0 - 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+160}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot t_0\right)\right) + x2 \cdot \left(-6 + x1 \cdot \left(x1 \cdot 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{-170}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.45e160Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around inf 0.1%
associate-*r/0.1%
*-commutative0.1%
associate-/l*0.1%
+-commutative0.1%
unpow20.1%
fma-udef0.1%
Simplified0.1%
Taylor expanded in x1 around 0 47.1%
associate-*r*47.1%
distribute-rgt-out47.1%
*-commutative47.1%
unpow247.1%
associate-*l*47.1%
Simplified47.1%
if -1.45e160 < x1 < -3.1999999999999999e-256 or 5.50000000000000018e-170 < x1 < 4.8000000000000004e146Initial program 91.6%
Taylor expanded in x1 around 0 88.0%
*-commutative88.0%
fma-def88.0%
+-commutative88.0%
mul-1-neg88.0%
unsub-neg88.0%
+-commutative88.0%
unpow388.0%
unpow288.0%
distribute-lft-out88.6%
unpow288.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x1 around 0 60.1%
if -3.1999999999999999e-256 < x1 < 5.50000000000000018e-170Initial program 99.7%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x1 around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
Simplified97.1%
if 4.8000000000000004e146 < x1 Initial program 8.1%
Taylor expanded in x1 around 0 8.1%
*-commutative8.1%
fma-def8.1%
+-commutative8.1%
mul-1-neg8.1%
unsub-neg8.1%
+-commutative8.1%
unpow38.1%
unpow28.1%
distribute-lft-out8.1%
unpow28.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in x1 around 0 7.0%
flip-+84.2%
*-commutative84.2%
*-commutative84.2%
*-commutative84.2%
Applied egg-rr84.2%
swap-sqr84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification67.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -1.8e-258)
t_0
(if (<= x1 3.1e-214)
(* x2 -6.0)
(if (<= x1 4.8e+146)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.8e-258) {
tmp = t_0;
} else if (x1 <= 3.1e-214) {
tmp = x2 * -6.0;
} else if (x1 <= 4.8e+146) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-1.8d-258)) then
tmp = t_0
else if (x1 <= 3.1d-214) then
tmp = x2 * (-6.0d0)
else if (x1 <= 4.8d+146) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -1.8e-258) {
tmp = t_0;
} else if (x1 <= 3.1e-214) {
tmp = x2 * -6.0;
} else if (x1 <= 4.8e+146) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -1.8e-258: tmp = t_0 elif x1 <= 3.1e-214: tmp = x2 * -6.0 elif x1 <= 4.8e+146: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -1.8e-258) tmp = t_0; elseif (x1 <= 3.1e-214) tmp = Float64(x2 * -6.0); elseif (x1 <= 4.8e+146) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -1.8e-258) tmp = t_0; elseif (x1 <= 3.1e-214) tmp = x2 * -6.0; elseif (x1 <= 4.8e+146) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.8e-258], t$95$0, If[LessEqual[x1, 3.1e-214], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x1, 4.8e+146], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -1.8 \cdot 10^{-258}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-214}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+146}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -1.79999999999999989e-258 or 3.10000000000000004e-214 < x1 < 4.8000000000000004e146Initial program 83.8%
Taylor expanded in x1 around 0 80.6%
*-commutative80.6%
fma-def80.6%
+-commutative80.6%
mul-1-neg80.6%
unsub-neg80.6%
+-commutative80.6%
unpow380.6%
unpow280.6%
distribute-lft-out81.1%
unpow281.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in x1 around 0 56.0%
if -1.79999999999999989e-258 < x1 < 3.10000000000000004e-214Initial program 99.7%
Taylor expanded in x1 around 0 99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
unpow399.7%
unpow299.7%
distribute-lft-out99.7%
unpow299.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around 0 97.9%
Taylor expanded in x1 around 0 98.0%
*-commutative98.0%
Simplified98.0%
if 4.8000000000000004e146 < x1 Initial program 8.1%
Taylor expanded in x1 around 0 8.1%
*-commutative8.1%
fma-def8.1%
+-commutative8.1%
mul-1-neg8.1%
unsub-neg8.1%
+-commutative8.1%
unpow38.1%
unpow28.1%
distribute-lft-out8.1%
unpow28.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in x1 around 0 7.0%
flip-+84.2%
*-commutative84.2%
*-commutative84.2%
*-commutative84.2%
Applied egg-rr84.2%
swap-sqr84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification64.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0
(+
x1
(+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))))
(if (<= x1 -3.5e-256)
t_0
(if (<= x1 3.15e-171)
(+ x1 (+ (+ x1 (* 4.0 (* x1 (* x2 -3.0)))) (* 3.0 (- (* x2 -2.0) x1))))
(if (<= x1 4.8e+146)
t_0
(/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0))))))))
double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -3.5e-256) {
tmp = t_0;
} else if (x1 <= 3.15e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 4.8e+146) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
if (x1 <= (-3.5d-256)) then
tmp = t_0
else if (x1 <= 3.15d-171) then
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * (-3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else if (x1 <= 4.8d+146) then
tmp = t_0
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
double tmp;
if (x1 <= -3.5e-256) {
tmp = t_0;
} else if (x1 <= 3.15e-171) {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else if (x1 <= 4.8e+146) {
tmp = t_0;
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) tmp = 0 if x1 <= -3.5e-256: tmp = t_0 elif x1 <= 3.15e-171: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))) elif x1 <= 4.8e+146: tmp = t_0 else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))) tmp = 0.0 if (x1 <= -3.5e-256) tmp = t_0; elseif (x1 <= 3.15e-171) tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * -3.0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); elseif (x1 <= 4.8e+146) tmp = t_0; else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); tmp = 0.0; if (x1 <= -3.5e-256) tmp = t_0; elseif (x1 <= 3.15e-171) tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * -3.0)))) + (3.0 * ((x2 * -2.0) - x1))); elseif (x1 <= 4.8e+146) tmp = t_0; else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.5e-256], t$95$0, If[LessEqual[x1, 3.15e-171], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.8e+146], t$95$0, N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{-256}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x1 \leq 3.15 \cdot 10^{-171}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot -3\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 4.8 \cdot 10^{+146}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x1 < -3.50000000000000014e-256 or 3.1500000000000001e-171 < x1 < 4.8000000000000004e146Initial program 83.1%
Taylor expanded in x1 around 0 79.8%
*-commutative79.8%
fma-def79.8%
+-commutative79.8%
mul-1-neg79.8%
unsub-neg79.8%
+-commutative79.8%
unpow379.8%
unpow279.8%
distribute-lft-out80.4%
unpow280.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in x1 around 0 54.8%
if -3.50000000000000014e-256 < x1 < 3.1500000000000001e-171Initial program 99.7%
Taylor expanded in x1 around 0 77.7%
Taylor expanded in x2 around 0 97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x1 around 0 97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
Simplified97.1%
if 4.8000000000000004e146 < x1 Initial program 8.1%
Taylor expanded in x1 around 0 8.1%
*-commutative8.1%
fma-def8.1%
+-commutative8.1%
mul-1-neg8.1%
unsub-neg8.1%
+-commutative8.1%
unpow38.1%
unpow28.1%
distribute-lft-out8.1%
unpow28.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in x1 around 0 7.0%
flip-+84.2%
*-commutative84.2%
*-commutative84.2%
*-commutative84.2%
Applied egg-rr84.2%
swap-sqr84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification64.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.4e+137) (not (<= x2 2.1e+126))) (* 8.0 (* x2 (* x1 x2))) (/ (- (* x1 x1) (* (* x2 x2) 36.0)) (- x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.4e+137) || !(x2 <= 2.1e+126)) {
tmp = 8.0 * (x2 * (x1 * x2));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (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.4d+137)) .or. (.not. (x2 <= 2.1d+126))) then
tmp = 8.0d0 * (x2 * (x1 * x2))
else
tmp = ((x1 * x1) - ((x2 * x2) * 36.0d0)) / (x1 - (x2 * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.4e+137) || !(x2 <= 2.1e+126)) {
tmp = 8.0 * (x2 * (x1 * x2));
} else {
tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.4e+137) or not (x2 <= 2.1e+126): tmp = 8.0 * (x2 * (x1 * x2)) else: tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.4e+137) || !(x2 <= 2.1e+126)) tmp = Float64(8.0 * Float64(x2 * Float64(x1 * x2))); else tmp = Float64(Float64(Float64(x1 * x1) - Float64(Float64(x2 * x2) * 36.0)) / Float64(x1 - Float64(x2 * -6.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.4e+137) || ~((x2 <= 2.1e+126))) tmp = 8.0 * (x2 * (x1 * x2)); else tmp = ((x1 * x1) - ((x2 * x2) * 36.0)) / (x1 - (x2 * -6.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.4e+137], N[Not[LessEqual[x2, 2.1e+126]], $MachinePrecision]], N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x1 * x1), $MachinePrecision] - N[(N[(x2 * x2), $MachinePrecision] * 36.0), $MachinePrecision]), $MachinePrecision] / N[(x1 - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.4 \cdot 10^{+137} \lor \neg \left(x2 \leq 2.1 \cdot 10^{+126}\right):\\
\;\;\;\;8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x1 \cdot x1 - \left(x2 \cdot x2\right) \cdot 36}{x1 - x2 \cdot -6}\\
\end{array}
\end{array}
if x2 < -1.4e137 or 2.0999999999999999e126 < x2 Initial program 85.6%
Taylor expanded in x1 around 0 53.5%
Taylor expanded in x1 around inf 57.9%
Taylor expanded in x2 around inf 57.9%
*-commutative57.9%
unpow257.9%
associate-*l*72.2%
Simplified72.2%
if -1.4e137 < x2 < 2.0999999999999999e126Initial program 70.4%
Taylor expanded in x1 around 0 68.8%
*-commutative68.8%
fma-def68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
+-commutative68.8%
unpow368.8%
unpow268.8%
distribute-lft-out69.3%
unpow269.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in x1 around 0 34.6%
flip-+47.8%
*-commutative47.8%
*-commutative47.8%
*-commutative47.8%
Applied egg-rr47.8%
swap-sqr47.6%
metadata-eval47.6%
Simplified47.6%
Final simplification54.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -4.8e-93) (not (<= x1 4.2e-99))) (* 8.0 (* x1 (* x2 x2))) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e-93) || !(x1 <= 4.2e-99)) {
tmp = 8.0 * (x1 * (x2 * x2));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-4.8d-93)) .or. (.not. (x1 <= 4.2d-99))) then
tmp = 8.0d0 * (x1 * (x2 * x2))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -4.8e-93) || !(x1 <= 4.2e-99)) {
tmp = 8.0 * (x1 * (x2 * x2));
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -4.8e-93) or not (x1 <= 4.2e-99): tmp = 8.0 * (x1 * (x2 * x2)) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -4.8e-93) || !(x1 <= 4.2e-99)) tmp = Float64(8.0 * Float64(x1 * Float64(x2 * x2))); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -4.8e-93) || ~((x1 <= 4.2e-99))) tmp = 8.0 * (x1 * (x2 * x2)); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -4.8e-93], N[Not[LessEqual[x1, 4.2e-99]], $MachinePrecision]], N[(8.0 * N[(x1 * N[(x2 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{-93} \lor \neg \left(x1 \leq 4.2 \cdot 10^{-99}\right):\\
\;\;\;\;8 \cdot \left(x1 \cdot \left(x2 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -4.8000000000000002e-93 or 4.19999999999999968e-99 < x1 Initial program 59.9%
Taylor expanded in x1 around 0 29.7%
Taylor expanded in x1 around inf 27.7%
Taylor expanded in x2 around inf 26.7%
unpow226.7%
Simplified26.7%
if -4.8000000000000002e-93 < x1 < 4.19999999999999968e-99Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
*-commutative99.5%
fma-def99.5%
+-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
+-commutative99.5%
unpow399.5%
unpow299.5%
distribute-lft-out99.5%
unpow299.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around 0 70.2%
Taylor expanded in x1 around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification43.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -5.1e+126) (not (<= x2 7.5e+125))) (* 8.0 (* x2 (* x1 x2))) (+ x1 (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -5.1e+126) || !(x2 <= 7.5e+125)) {
tmp = 8.0 * (x2 * (x1 * x2));
} 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 <= (-5.1d+126)) .or. (.not. (x2 <= 7.5d+125))) then
tmp = 8.0d0 * (x2 * (x1 * x2))
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -5.1e+126) || !(x2 <= 7.5e+125)) {
tmp = 8.0 * (x2 * (x1 * x2));
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -5.1e+126) or not (x2 <= 7.5e+125): tmp = 8.0 * (x2 * (x1 * x2)) else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -5.1e+126) || !(x2 <= 7.5e+125)) tmp = Float64(8.0 * Float64(x2 * Float64(x1 * x2))); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -5.1e+126) || ~((x2 <= 7.5e+125))) tmp = 8.0 * (x2 * (x1 * x2)); else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -5.1e+126], N[Not[LessEqual[x2, 7.5e+125]], $MachinePrecision]], N[(8.0 * N[(x2 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.1 \cdot 10^{+126} \lor \neg \left(x2 \leq 7.5 \cdot 10^{+125}\right):\\
\;\;\;\;8 \cdot \left(x2 \cdot \left(x1 \cdot x2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -5.1000000000000001e126 or 7.5000000000000006e125 < x2 Initial program 83.2%
Taylor expanded in x1 around 0 52.1%
Taylor expanded in x1 around inf 59.0%
Taylor expanded in x2 around inf 59.0%
*-commutative59.0%
unpow259.0%
associate-*l*73.0%
Simplified73.0%
if -5.1000000000000001e126 < x2 < 7.5000000000000006e125Initial program 71.2%
Taylor expanded in x1 around 0 69.6%
*-commutative69.6%
fma-def69.6%
+-commutative69.6%
mul-1-neg69.6%
unsub-neg69.6%
+-commutative69.6%
unpow369.6%
unpow269.6%
distribute-lft-out70.1%
unpow270.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in x1 around 0 34.9%
Final simplification45.6%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 74.6%
Taylor expanded in x1 around 0 72.2%
*-commutative72.2%
fma-def72.2%
+-commutative72.2%
mul-1-neg72.2%
unsub-neg72.2%
+-commutative72.2%
unpow372.2%
unpow272.2%
distribute-lft-out72.6%
unpow272.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in x1 around 0 29.3%
Final simplification29.3%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 74.6%
Taylor expanded in x1 around 0 72.2%
*-commutative72.2%
fma-def72.2%
+-commutative72.2%
mul-1-neg72.2%
unsub-neg72.2%
+-commutative72.2%
unpow372.2%
unpow272.2%
distribute-lft-out72.6%
unpow272.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in x1 around 0 29.3%
Taylor expanded in x1 around 0 29.0%
*-commutative29.0%
Simplified29.0%
Final simplification29.0%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 74.6%
Taylor expanded in x1 around 0 50.1%
Taylor expanded in x1 around inf 21.4%
Taylor expanded in x1 around 0 3.5%
Final simplification3.5%
herbie shell --seed 2023275
(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))))))