
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (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[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - 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$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + 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 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \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\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {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.5%
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%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
fma-define0.0%
clear-num0.0%
inv-pow0.0%
*-commutative0.0%
*-commutative0.0%
fma-undefine0.0%
fma-undefine0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
fma-define0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in x1 around inf 97.5%
Final simplification99.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
x1
(+ t_0 (+ t_4 (* t_3 (+ (exp (log1p (* 3.0 (pow x1 2.0)))) -1.0)))))
(*
3.0
(-
(/ (fma 3.0 (pow x1 2.0) (* x2 -2.0)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (t_3 * (exp(log1p((3.0 * pow(x1, 2.0)))) + -1.0))))) + (3.0 * ((fma(3.0, pow(x1, 2.0), (x2 * -2.0)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.0)))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(t_3 * Float64(exp(log1p(Float64(3.0 * (x1 ^ 2.0)))) + -1.0))))) + Float64(3.0 * Float64(Float64(fma(3.0, (x1 ^ 2.0), Float64(x2 * -2.0)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.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 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(t$95$3 * N[(N[Exp[N[Log[1 + N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.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 x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_4 + t\_3 \cdot \left(e^{\mathsf{log1p}\left(3 \cdot {x1}^{2}\right)} + -1\right)\right)\right)\right) + 3 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\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.5%
fma-define99.5%
div-sub99.5%
cancel-sign-sub-inv99.5%
associate-*r*99.5%
fma-define99.5%
pow299.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-*r*99.5%
expm1-log1p-u99.5%
expm1-undefine99.5%
pow299.5%
Applied egg-rr99.5%
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%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
fma-define0.0%
clear-num0.0%
inv-pow0.0%
*-commutative0.0%
*-commutative0.0%
fma-undefine0.0%
fma-undefine0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
fma-define0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in x1 around inf 97.5%
Final simplification98.9%
(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
(+
(+
(*
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))))))
(if (<= (+ x1 (+ t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))) INFINITY)
(+
x1
(+
t_3
(*
3.0
(-
(/ (fma 3.0 (pow x1 2.0) (* x2 -2.0)) (fma x1 x1 1.0))
(/ x1 (fma x1 x1 1.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 = 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)));
double tmp;
if ((x1 + (t_3 + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (3.0 * ((fma(3.0, pow(x1, 2.0), (x2 * -2.0)) / fma(x1, x1, 1.0)) - (x1 / fma(x1, x1, 1.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(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)))) tmp = 0.0 if (Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(3.0 * Float64(Float64(fma(3.0, (x1 ^ 2.0), Float64(x2 * -2.0)) / fma(x1, x1, 1.0)) - Float64(x1 / fma(x1, x1, 1.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[(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]}, If[LessEqual[N[(x1 + N[(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]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(3.0 * N[(N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] - N[(x1 / N[(x1 * x1 + 1.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 := 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)\\
\mathbf{if}\;x1 + \left(t\_3 + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_3 + 3 \cdot \left(\frac{\mathsf{fma}\left(3, {x1}^{2}, x2 \cdot -2\right)}{\mathsf{fma}\left(x1, x1, 1\right)} - \frac{x1}{\mathsf{fma}\left(x1, x1, 1\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.5%
fma-define99.5%
div-sub99.5%
cancel-sign-sub-inv99.5%
associate-*r*99.5%
fma-define99.5%
pow299.5%
metadata-eval99.5%
Applied egg-rr99.5%
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%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
fma-define0.0%
clear-num0.0%
inv-pow0.0%
*-commutative0.0%
*-commutative0.0%
fma-undefine0.0%
fma-undefine0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
fma-define0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in x1 around inf 97.5%
Final simplification98.9%
(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.5%
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%
mul-1-neg0.0%
unsub-neg0.0%
Simplified0.0%
fma-define0.0%
clear-num0.0%
inv-pow0.0%
*-commutative0.0%
*-commutative0.0%
fma-undefine0.0%
fma-undefine0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
fma-define0.0%
pow20.0%
Applied egg-rr0.0%
Taylor expanded in x1 around inf 97.5%
Final simplification98.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_5 (* t_2 t_3))
(t_6 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_7 (* x2 (- (* 2.0 x2) 3.0)))
(t_8 (+ x1 (+ t_4 (+ x1 (* 4.0 (* x1 t_7)))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -1.3e+42)
(+ x1 (+ 9.0 (+ x1 (+ t_1 (+ t_5 (* t_0 (+ (* x1 2.0) t_6)))))))
(if (<= x1 -6.2e-160)
t_8
(if (<= x1 2.35e-269)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 5.6e+14)
t_8
(if (<= x1 2.55e+153)
(+
x1
(+
t_4
(+
x1
(+
t_1
(+
t_5
(*
t_0
(+ t_6 (+ (* x1 2.0) (* -2.0 (- (* x2 4.0) 3.0))))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 t_7))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_5 = t_2 * t_3;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = x2 * ((2.0 * x2) - 3.0);
double t_8 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_7))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -1.3e+42) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6))))));
} else if (x1 <= -6.2e-160) {
tmp = t_8;
} else if (x1 <= 2.35e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 5.6e+14) {
tmp = t_8;
} else if (x1 <= 2.55e+153) {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_7)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_5 = t_2 * t_3
t_6 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_7 = x2 * ((2.0d0 * x2) - 3.0d0)
t_8 = x1 + (t_4 + (x1 + (4.0d0 * (x1 * t_7))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-1.3d+42)) then
tmp = x1 + (9.0d0 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0d0) + t_6))))))
else if (x1 <= (-6.2d-160)) then
tmp = t_8
else if (x1 <= 2.35d-269) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 5.6d+14) then
tmp = t_8
else if (x1 <= 2.55d+153) then
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + ((x1 * 2.0d0) + ((-2.0d0) * ((x2 * 4.0d0) - 3.0d0)))))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_7)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_5 = t_2 * t_3;
double t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_7 = x2 * ((2.0 * x2) - 3.0);
double t_8 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_7))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -1.3e+42) {
tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6))))));
} else if (x1 <= -6.2e-160) {
tmp = t_8;
} else if (x1 <= 2.35e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 5.6e+14) {
tmp = t_8;
} else if (x1 <= 2.55e+153) {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0)))))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_7)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_5 = t_2 * t_3 t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_7 = x2 * ((2.0 * x2) - 3.0) t_8 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_7)))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -1.3e+42: tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6)))))) elif x1 <= -6.2e-160: tmp = t_8 elif x1 <= 2.35e-269: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 5.6e+14: tmp = t_8 elif x1 <= 2.55e+153: tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0))))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * t_7))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_5 = Float64(t_2 * t_3) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_7 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_8 = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(4.0 * Float64(x1 * t_7))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -1.3e+42) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(Float64(x1 * 2.0) + t_6))))))); elseif (x1 <= -6.2e-160) tmp = t_8; elseif (x1 <= 2.35e-269) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 5.6e+14) tmp = t_8; elseif (x1 <= 2.55e+153) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_1 + Float64(t_5 + Float64(t_0 * Float64(t_6 + Float64(Float64(x1 * 2.0) + Float64(-2.0 * Float64(Float64(x2 * 4.0) - 3.0)))))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_7)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_5 = t_2 * t_3; t_6 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_7 = x2 * ((2.0 * x2) - 3.0); t_8 = x1 + (t_4 + (x1 + (4.0 * (x1 * t_7)))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -1.3e+42) tmp = x1 + (9.0 + (x1 + (t_1 + (t_5 + (t_0 * ((x1 * 2.0) + t_6)))))); elseif (x1 <= -6.2e-160) tmp = t_8; elseif (x1 <= 2.35e-269) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 5.6e+14) tmp = t_8; elseif (x1 <= 2.55e+153) tmp = x1 + (t_4 + (x1 + (t_1 + (t_5 + (t_0 * (t_6 + ((x1 * 2.0) + (-2.0 * ((x2 * 4.0) - 3.0))))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * t_7))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 + N[(t$95$4 + N[(x1 + N[(4.0 * N[(x1 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.3e+42], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -6.2e-160], t$95$8, If[LessEqual[x1, 2.35e-269], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.6e+14], t$95$8, If[LessEqual[x1, 2.55e+153], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$1 + N[(t$95$5 + N[(t$95$0 * N[(t$95$6 + N[(N[(x1 * 2.0), $MachinePrecision] + N[(-2.0 * N[(N[(x2 * 4.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := t\_2 \cdot t\_3\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_7 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_8 := x1 + \left(t\_4 + \left(x1 + 4 \cdot \left(x1 \cdot t\_7\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(x1 \cdot 2 + t\_6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-160}:\\
\;\;\;\;t\_8\\
\mathbf{elif}\;x1 \leq 2.35 \cdot 10^{-269}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 5.6 \cdot 10^{+14}:\\
\;\;\;\;t\_8\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_1 + \left(t\_5 + t\_0 \cdot \left(t\_6 + \left(x1 \cdot 2 + -2 \cdot \left(x2 \cdot 4 - 3\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_7\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.8%
mul-1-neg2.8%
unsub-neg2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in x2 around 0 10.4%
if -5.60000000000000037e102 < x1 < -1.29999999999999995e42Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around inf 99.6%
if -1.29999999999999995e42 < x1 < -6.2000000000000001e-160 or 2.3499999999999999e-269 < x1 < 5.6e14Initial program 99.3%
Taylor expanded in x1 around 0 89.6%
if -6.2000000000000001e-160 < x1 < 2.3499999999999999e-269Initial program 99.8%
Taylor expanded in x2 around inf 68.7%
associate-*r/68.7%
+-commutative68.7%
unpow268.7%
fma-undefine68.7%
Simplified68.7%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 91.0%
*-commutative91.0%
Simplified91.0%
if 5.6e14 < x1 < 2.55000000000000018e153Initial program 91.6%
Taylor expanded in x1 around 0 84.1%
+-commutative84.1%
mul-1-neg84.1%
unsub-neg84.1%
Simplified84.1%
Taylor expanded in x1 around -inf 83.7%
if 2.55000000000000018e153 < x1 Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
Taylor expanded in x1 around inf 48.6%
Final simplification70.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_3)))
(t_5 (/ (- (+ t_2 (* 2.0 x2)) x1) t_3))
(t_6 (* t_2 t_5))
(t_7
(+
x1
(+
(+
x1
(+
t_1
(+
t_6
(*
t_3
(+
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(* (- t_5 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))
9.0)))
(t_8 (* 4.0 (* x1 t_0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -0.042)
t_7
(if (<= x1 -2.6e-159)
(+ x1 (+ t_4 (+ x1 (+ t_1 (+ t_6 (* t_3 t_8))))))
(if (<= x1 1.4e-269)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 2.15e-8)
(+ x1 (+ t_4 (+ x1 t_8)))
(if (<= x1 2.55e+153)
t_7
(+ x1 (* x1 (+ 1.0 (* 4.0 t_0))))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_2 * t_5;
double t_7 = x1 + ((x1 + (t_1 + (t_6 + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
double t_8 = 4.0 * (x1 * t_0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -0.042) {
tmp = t_7;
} else if (x1 <= -2.6e-159) {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_6 + (t_3 * t_8)))));
} else if (x1 <= 1.4e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2.15e-8) {
tmp = x1 + (t_4 + (x1 + t_8));
} else if (x1 <= 2.55e+153) {
tmp = t_7;
} else {
tmp = x1 + (x1 * (1.0 + (4.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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_3)
t_5 = ((t_2 + (2.0d0 * x2)) - x1) / t_3
t_6 = t_2 * t_5
t_7 = x1 + ((x1 + (t_1 + (t_6 + (t_3 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + ((t_5 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))) + 9.0d0)
t_8 = 4.0d0 * (x1 * t_0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-0.042d0)) then
tmp = t_7
else if (x1 <= (-2.6d-159)) then
tmp = x1 + (t_4 + (x1 + (t_1 + (t_6 + (t_3 * t_8)))))
else if (x1 <= 1.4d-269) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2.15d-8) then
tmp = x1 + (t_4 + (x1 + t_8))
else if (x1 <= 2.55d+153) then
tmp = t_7
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
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 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3);
double t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3;
double t_6 = t_2 * t_5;
double t_7 = x1 + ((x1 + (t_1 + (t_6 + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
double t_8 = 4.0 * (x1 * t_0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -0.042) {
tmp = t_7;
} else if (x1 <= -2.6e-159) {
tmp = x1 + (t_4 + (x1 + (t_1 + (t_6 + (t_3 * t_8)))));
} else if (x1 <= 1.4e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2.15e-8) {
tmp = x1 + (t_4 + (x1 + t_8));
} else if (x1 <= 2.55e+153) {
tmp = t_7;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = (x1 * x1) + 1.0 t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3) t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3 t_6 = t_2 * t_5 t_7 = x1 + ((x1 + (t_1 + (t_6 + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0) t_8 = 4.0 * (x1 * t_0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -0.042: tmp = t_7 elif x1 <= -2.6e-159: tmp = x1 + (t_4 + (x1 + (t_1 + (t_6 + (t_3 * t_8))))) elif x1 <= 1.4e-269: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 2.15e-8: tmp = x1 + (t_4 + (x1 + t_8)) elif x1 <= 2.55e+153: tmp = t_7 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_3)) t_5 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_3) t_6 = Float64(t_2 * t_5) t_7 = Float64(x1 + Float64(Float64(x1 + Float64(t_1 + Float64(t_6 + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(Float64(t_5 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))) + 9.0)) t_8 = Float64(4.0 * Float64(x1 * t_0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -0.042) tmp = t_7; elseif (x1 <= -2.6e-159) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_1 + Float64(t_6 + Float64(t_3 * t_8)))))); elseif (x1 <= 1.4e-269) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 2.15e-8) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + t_8))); elseif (x1 <= 2.55e+153) tmp = t_7; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = (x1 * x1) + 1.0; t_4 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_3); t_5 = ((t_2 + (2.0 * x2)) - x1) / t_3; t_6 = t_2 * t_5; t_7 = x1 + ((x1 + (t_1 + (t_6 + (t_3 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0); t_8 = 4.0 * (x1 * t_0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -0.042) tmp = t_7; elseif (x1 <= -2.6e-159) tmp = x1 + (t_4 + (x1 + (t_1 + (t_6 + (t_3 * t_8))))); elseif (x1 <= 1.4e-269) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 2.15e-8) tmp = x1 + (t_4 + (x1 + t_8)); elseif (x1 <= 2.55e+153) tmp = t_7; else tmp = x1 + (x1 * (1.0 + (4.0 * t_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[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * t$95$5), $MachinePrecision]}, Block[{t$95$7 = N[(x1 + N[(N[(x1 + N[(t$95$1 + N[(t$95$6 + N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.042], t$95$7, If[LessEqual[x1, -2.6e-159], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$1 + N[(t$95$6 + N[(t$95$3 * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.4e-269], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.15e-8], N[(x1 + N[(t$95$4 + N[(x1 + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.55e+153], t$95$7, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_3}\\
t_6 := t\_2 \cdot t\_5\\
t_7 := x1 + \left(\left(x1 + \left(t\_1 + \left(t\_6 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + \left(t\_5 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right) + 9\right)\\
t_8 := 4 \cdot \left(x1 \cdot t\_0\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.042:\\
\;\;\;\;t\_7\\
\mathbf{elif}\;x1 \leq -2.6 \cdot 10^{-159}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_1 + \left(t\_6 + t\_3 \cdot t\_8\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.4 \cdot 10^{-269}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2.15 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + t\_8\right)\right)\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+153}:\\
\;\;\;\;t\_7\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.8%
mul-1-neg2.8%
unsub-neg2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in x2 around 0 10.4%
if -5.60000000000000037e102 < x1 < -0.0420000000000000026 or 2.1500000000000001e-8 < x1 < 2.55000000000000018e153Initial program 95.1%
Taylor expanded in x1 around 0 87.5%
+-commutative87.5%
mul-1-neg87.5%
unsub-neg87.5%
Simplified87.5%
Taylor expanded in x1 around inf 87.5%
if -0.0420000000000000026 < x1 < -2.5999999999999998e-159Initial program 99.2%
Taylor expanded in x1 around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
fma-define97.3%
clear-num97.3%
inv-pow97.3%
*-commutative97.3%
*-commutative97.3%
fma-undefine97.3%
fma-undefine97.3%
*-commutative97.3%
*-commutative97.3%
associate-*r*97.3%
fma-define97.3%
pow297.3%
Applied egg-rr97.3%
Taylor expanded in x1 around 0 94.6%
if -2.5999999999999998e-159 < x1 < 1.39999999999999997e-269Initial program 99.8%
Taylor expanded in x2 around inf 68.7%
associate-*r/68.7%
+-commutative68.7%
unpow268.7%
fma-undefine68.7%
Simplified68.7%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 91.0%
*-commutative91.0%
Simplified91.0%
if 1.39999999999999997e-269 < x1 < 2.1500000000000001e-8Initial program 99.3%
Taylor expanded in x1 around 0 92.7%
if 2.55000000000000018e153 < x1 Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
Taylor expanded in x1 around inf 48.6%
Final simplification71.7%
(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 -5e+44) (not (<= x1 1.55e+30)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (* (* x1 2.0) t_2) (- (* 2.0 x2) 3.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+44) || !(x1 <= 1.55e+30)) {
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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.0))))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5d+44)) .or. (.not. (x1 <= 1.55d+30))) 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((x1 * 2.0d0) * t_2) * ((2.0d0 * x2) - 3.0d0))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5e+44) || !(x1 <= 1.55e+30)) {
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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.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 <= -5e+44) or not (x1 <= 1.55e+30): 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.0)))))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5e+44) || !(x1 <= 1.55e+30)) 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_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(Float64(2.0 * x2) - 3.0))))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5e+44) || ~((x1 <= 1.55e+30))) 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((x1 * 2.0) * t_2) * ((2.0 * x2) - 3.0)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5e+44], N[Not[LessEqual[x1, 1.55e+30]], $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$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+44} \lor \neg \left(x1 \leq 1.55 \cdot 10^{+30}\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\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.9999999999999996e44 or 1.5499999999999999e30 < x1 Initial program 26.9%
Taylor expanded in x1 around 0 24.3%
+-commutative24.3%
mul-1-neg24.3%
unsub-neg24.3%
Simplified24.3%
fma-define24.3%
clear-num24.3%
inv-pow24.3%
*-commutative24.3%
*-commutative24.3%
fma-undefine24.3%
fma-undefine24.3%
*-commutative24.3%
*-commutative24.3%
associate-*r*23.4%
fma-define24.3%
pow224.3%
Applied egg-rr24.3%
Taylor expanded in x1 around inf 96.4%
if -4.9999999999999996e44 < x1 < 1.5499999999999999e30Initial program 99.4%
Taylor expanded in x1 around 0 98.0%
Final simplification97.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (* (* x1 2.0) (- (* 2.0 x2) x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_3))
(t_5 (* t_1 t_4))
(t_6 (* x1 (* x1 x1)))
(t_7 (* (* x1 x1) (- (* t_4 4.0) 6.0)))
(t_8
(+
x1
(+ (+ x1 (+ t_6 (+ t_5 (* t_3 (+ t_7 (* (- t_4 3.0) t_2)))))) 9.0))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -0.042)
t_8
(if (<= x1 2.15e-8)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_3))
(+ x1 (+ t_6 (+ t_5 (* t_3 (+ t_7 (* t_0 t_2))))))))
(if (<= x1 2.55e+153)
t_8
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_0)))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * 2.0) * ((2.0 * x2) - x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_1 * t_4;
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_8 = x1 + ((x1 + (t_6 + (t_5 + (t_3 * (t_7 + ((t_4 - 3.0) * t_2)))))) + 9.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -0.042) {
tmp = t_8;
} else if (x1 <= 2.15e-8) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_6 + (t_5 + (t_3 * (t_7 + (t_0 * t_2)))))));
} else if (x1 <= 2.55e+153) {
tmp = t_8;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * 2.0d0) * ((2.0d0 * x2) - x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = ((t_1 + (2.0d0 * x2)) - x1) / t_3
t_5 = t_1 * t_4
t_6 = x1 * (x1 * x1)
t_7 = (x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)
t_8 = x1 + ((x1 + (t_6 + (t_5 + (t_3 * (t_7 + ((t_4 - 3.0d0) * t_2)))))) + 9.0d0)
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-0.042d0)) then
tmp = t_8
else if (x1 <= 2.15d-8) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_3)) + (x1 + (t_6 + (t_5 + (t_3 * (t_7 + (t_0 * t_2)))))))
else if (x1 <= 2.55d+153) then
tmp = t_8
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * 2.0) * ((2.0 * x2) - x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3;
double t_5 = t_1 * t_4;
double t_6 = x1 * (x1 * x1);
double t_7 = (x1 * x1) * ((t_4 * 4.0) - 6.0);
double t_8 = x1 + ((x1 + (t_6 + (t_5 + (t_3 * (t_7 + ((t_4 - 3.0) * t_2)))))) + 9.0);
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -0.042) {
tmp = t_8;
} else if (x1 <= 2.15e-8) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_6 + (t_5 + (t_3 * (t_7 + (t_0 * t_2)))))));
} else if (x1 <= 2.55e+153) {
tmp = t_8;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = x1 * (x1 * 3.0) t_2 = (x1 * 2.0) * ((2.0 * x2) - x1) t_3 = (x1 * x1) + 1.0 t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3 t_5 = t_1 * t_4 t_6 = x1 * (x1 * x1) t_7 = (x1 * x1) * ((t_4 * 4.0) - 6.0) t_8 = x1 + ((x1 + (t_6 + (t_5 + (t_3 * (t_7 + ((t_4 - 3.0) * t_2)))))) + 9.0) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -0.042: tmp = t_8 elif x1 <= 2.15e-8: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_6 + (t_5 + (t_3 * (t_7 + (t_0 * t_2))))))) elif x1 <= 2.55e+153: tmp = t_8 else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_3) t_5 = Float64(t_1 * t_4) t_6 = Float64(x1 * Float64(x1 * x1)) t_7 = Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) t_8 = Float64(x1 + Float64(Float64(x1 + Float64(t_6 + Float64(t_5 + Float64(t_3 * Float64(t_7 + Float64(Float64(t_4 - 3.0) * t_2)))))) + 9.0)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -0.042) tmp = t_8; elseif (x1 <= 2.15e-8) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_3)) + Float64(x1 + Float64(t_6 + Float64(t_5 + Float64(t_3 * Float64(t_7 + Float64(t_0 * t_2)))))))); elseif (x1 <= 2.55e+153) tmp = t_8; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = x1 * (x1 * 3.0); t_2 = (x1 * 2.0) * ((2.0 * x2) - x1); t_3 = (x1 * x1) + 1.0; t_4 = ((t_1 + (2.0 * x2)) - x1) / t_3; t_5 = t_1 * t_4; t_6 = x1 * (x1 * x1); t_7 = (x1 * x1) * ((t_4 * 4.0) - 6.0); t_8 = x1 + ((x1 + (t_6 + (t_5 + (t_3 * (t_7 + ((t_4 - 3.0) * t_2)))))) + 9.0); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -0.042) tmp = t_8; elseif (x1 <= 2.15e-8) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_3)) + (x1 + (t_6 + (t_5 + (t_3 * (t_7 + (t_0 * t_2))))))); elseif (x1 <= 2.55e+153) tmp = t_8; else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 + N[(N[(x1 + N[(t$95$6 + N[(t$95$5 + N[(t$95$3 * N[(t$95$7 + N[(N[(t$95$4 - 3.0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -0.042], t$95$8, If[LessEqual[x1, 2.15e-8], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$6 + N[(t$95$5 + N[(t$95$3 * N[(t$95$7 + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.55e+153], t$95$8, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_3}\\
t_5 := t\_1 \cdot t\_4\\
t_6 := x1 \cdot \left(x1 \cdot x1\right)\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\\
t_8 := x1 + \left(\left(x1 + \left(t\_6 + \left(t\_5 + t\_3 \cdot \left(t\_7 + \left(t\_4 - 3\right) \cdot t\_2\right)\right)\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -0.042:\\
\;\;\;\;t\_8\\
\mathbf{elif}\;x1 \leq 2.15 \cdot 10^{-8}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_3} + \left(x1 + \left(t\_6 + \left(t\_5 + t\_3 \cdot \left(t\_7 + t\_0 \cdot t\_2\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+153}:\\
\;\;\;\;t\_8\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.8%
mul-1-neg2.8%
unsub-neg2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in x2 around 0 10.4%
if -5.60000000000000037e102 < x1 < -0.0420000000000000026 or 2.1500000000000001e-8 < x1 < 2.55000000000000018e153Initial program 95.1%
Taylor expanded in x1 around 0 87.5%
+-commutative87.5%
mul-1-neg87.5%
unsub-neg87.5%
Simplified87.5%
Taylor expanded in x1 around inf 87.5%
if -0.0420000000000000026 < x1 < 2.1500000000000001e-8Initial program 99.4%
Taylor expanded in x1 around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
Taylor expanded in x1 around 0 99.0%
if 2.55000000000000018e153 < x1 Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
Taylor expanded in x1 around inf 48.6%
Final simplification75.0%
(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.3e+42) (not (<= x1 55000000.0)))
(+ x1 (* 6.0 (pow x1 4.0)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (- (* 2.0 x2) 3.0) (* (* x1 2.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.3e+42) || !(x1 <= 55000000.0)) {
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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.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.3d+42)) .or. (.not. (x1 <= 55000000.0d0))) 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (((2.0d0 * x2) - 3.0d0) * ((x1 * 2.0d0) * ((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.3e+42) || !(x1 <= 55000000.0)) {
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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.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.3e+42) or not (x1 <= 55000000.0): 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.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.3e+42) || !(x1 <= 55000000.0)) 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_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(Float64(2.0 * x2) - 3.0) * Float64(Float64(x1 * 2.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.3e+42) || ~((x1 <= 55000000.0))) 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_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + (((2.0 * x2) - 3.0) * ((x1 * 2.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.3e+42], N[Not[LessEqual[x1, 55000000.0]], $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$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1.3 \cdot 10^{+42} \lor \neg \left(x1 \leq 55000000\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\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(2 \cdot x2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.29999999999999995e42 or 5.5e7 < x1 Initial program 28.2%
Taylor expanded in x1 around 0 25.7%
+-commutative25.7%
mul-1-neg25.7%
unsub-neg25.7%
Simplified25.7%
fma-define25.7%
clear-num25.7%
inv-pow25.7%
*-commutative25.7%
*-commutative25.7%
fma-undefine25.7%
fma-undefine25.7%
*-commutative25.7%
*-commutative25.7%
associate-*r*24.8%
fma-define25.7%
pow225.7%
Applied egg-rr25.7%
Taylor expanded in x1 around inf 96.4%
if -1.29999999999999995e42 < x1 < 5.5e7Initial program 99.4%
Taylor expanded in x1 around 0 97.9%
+-commutative97.9%
mul-1-neg97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in x1 around 0 96.2%
Final simplification96.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_1))))))
(t_5
(+
x1
(+
9.0
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(* t_0 (+ (* x1 2.0) (* (* x1 x1) (- (* t_3 4.0) 6.0)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -1.3e+42)
t_5
(if (<= x1 -6.2e-160)
t_4
(if (<= x1 3.9e-269)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 115000000.0)
t_4
(if (<= x1 2.55e+153)
t_5
(+ x1 (* x1 (+ 1.0 (* 4.0 t_1))))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -1.3e+42) {
tmp = t_5;
} else if (x1 <= -6.2e-160) {
tmp = t_4;
} else if (x1 <= 3.9e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 115000000.0) {
tmp = t_4;
} else if (x1 <= 2.55e+153) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
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) + 1.0d0
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_1))))
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0d0) + ((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-1.3d+42)) then
tmp = t_5
else if (x1 <= (-6.2d-160)) then
tmp = t_4
else if (x1 <= 3.9d-269) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 115000000.0d0) then
tmp = t_4
else if (x1 <= 2.55d+153) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -1.3e+42) {
tmp = t_5;
} else if (x1 <= -6.2e-160) {
tmp = t_4;
} else if (x1 <= 3.9e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 115000000.0) {
tmp = t_4;
} else if (x1 <= 2.55e+153) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))) t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -1.3e+42: tmp = t_5 elif x1 <= -6.2e-160: tmp = t_4 elif x1 <= 3.9e-269: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 115000000.0: tmp = t_4 elif x1 <= 2.55e+153: tmp = t_5 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_1))))) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(x1 * 2.0) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -1.3e+42) tmp = t_5; elseif (x1 <= -6.2e-160) tmp = t_4; elseif (x1 <= 3.9e-269) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 115000000.0) tmp = t_4; elseif (x1 <= 2.55e+153) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))); t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * ((x1 * 2.0) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -1.3e+42) tmp = t_5; elseif (x1 <= -6.2e-160) tmp = t_4; elseif (x1 <= 3.9e-269) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 115000000.0) tmp = t_4; elseif (x1 <= 2.55e+153) tmp = t_5; else tmp = x1 + (x1 * (1.0 + (4.0 * t_1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(x1 * 2.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.3e+42], t$95$5, If[LessEqual[x1, -6.2e-160], t$95$4, If[LessEqual[x1, 3.9e-269], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 115000000.0], t$95$4, If[LessEqual[x1, 2.55e+153], t$95$5, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right)\right)\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(x1 \cdot 2 + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-160}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{-269}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 115000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+153}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_1\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.8%
mul-1-neg2.8%
unsub-neg2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in x2 around 0 10.4%
if -5.60000000000000037e102 < x1 < -1.29999999999999995e42 or 1.15e8 < x1 < 2.55000000000000018e153Initial program 93.6%
Taylor expanded in x1 around 0 87.8%
+-commutative87.8%
mul-1-neg87.8%
unsub-neg87.8%
Simplified87.8%
Taylor expanded in x1 around inf 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x1 around inf 87.5%
if -1.29999999999999995e42 < x1 < -6.2000000000000001e-160 or 3.9e-269 < x1 < 1.15e8Initial program 99.3%
Taylor expanded in x1 around 0 89.6%
if -6.2000000000000001e-160 < x1 < 3.9e-269Initial program 99.8%
Taylor expanded in x2 around inf 68.7%
associate-*r/68.7%
+-commutative68.7%
unpow268.7%
fma-undefine68.7%
Simplified68.7%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 91.0%
*-commutative91.0%
Simplified91.0%
if 2.55000000000000018e153 < x1 Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
Taylor expanded in x1 around inf 48.6%
Final simplification70.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x2 (- (* 2.0 x2) 3.0)))
(t_3 (* 4.0 t_2)))
(if (<= x1 -6.2e-160)
(+ x1 (+ (* x2 -6.0) (* x1 (- t_3 2.0))))
(if (<= x1 3.9e-269)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 2.55e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(* t_1 (* 4.0 (* x1 t_2))))))))
(+ x1 (* x1 (+ 1.0 t_3))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = 4.0 * t_2;
double tmp;
if (x1 <= -6.2e-160) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0)));
} else if (x1 <= 3.9e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2.55e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (4.0 * (x1 * t_2)))))));
} else {
tmp = x1 + (x1 * (1.0 + t_3));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x2 * ((2.0d0 * x2) - 3.0d0)
t_3 = 4.0d0 * t_2
if (x1 <= (-6.2d-160)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_3 - 2.0d0)))
else if (x1 <= 3.9d-269) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2.55d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) + (t_1 * (4.0d0 * (x1 * t_2)))))))
else
tmp = x1 + (x1 * (1.0d0 + t_3))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = 4.0 * t_2;
double tmp;
if (x1 <= -6.2e-160) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0)));
} else if (x1 <= 3.9e-269) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2.55e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (4.0 * (x1 * t_2)))))));
} else {
tmp = x1 + (x1 * (1.0 + t_3));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x2 * ((2.0 * x2) - 3.0) t_3 = 4.0 * t_2 tmp = 0 if x1 <= -6.2e-160: tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0))) elif x1 <= 3.9e-269: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 2.55e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (4.0 * (x1 * t_2))))))) else: tmp = x1 + (x1 * (1.0 + t_3)) 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(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_3 = Float64(4.0 * t_2) tmp = 0.0 if (x1 <= -6.2e-160) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_3 - 2.0)))); elseif (x1 <= 3.9e-269) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 2.55e+153) 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(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(t_1 * Float64(4.0 * Float64(x1 * t_2)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_3))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x2 * ((2.0 * x2) - 3.0); t_3 = 4.0 * t_2; tmp = 0.0; if (x1 <= -6.2e-160) tmp = x1 + ((x2 * -6.0) + (x1 * (t_3 - 2.0))); elseif (x1 <= 3.9e-269) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 2.55e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + (t_1 * (4.0 * (x1 * t_2))))))); else tmp = x1 + (x1 * (1.0 + t_3)); 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[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, If[LessEqual[x1, -6.2e-160], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$3 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.9e-269], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.55e+153], 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[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$3), $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 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_3 := 4 \cdot t\_2\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{-160}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_3 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 3.9 \cdot 10^{-269}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2.55 \cdot 10^{+153}:\\
\;\;\;\;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 \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} + t\_1 \cdot \left(4 \cdot \left(x1 \cdot t\_2\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_3\right)\\
\end{array}
\end{array}
if x1 < -6.2000000000000001e-160Initial program 54.0%
Taylor expanded in x1 around 0 39.9%
Taylor expanded in x1 around 0 41.1%
if -6.2000000000000001e-160 < x1 < 3.9e-269Initial program 99.8%
Taylor expanded in x2 around inf 68.7%
associate-*r/68.7%
+-commutative68.7%
unpow268.7%
fma-undefine68.7%
Simplified68.7%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 91.0%
*-commutative91.0%
Simplified91.0%
if 3.9e-269 < x1 < 2.55000000000000018e153Initial program 97.0%
Taylor expanded in x1 around 0 93.6%
+-commutative93.6%
mul-1-neg93.6%
unsub-neg93.6%
Simplified93.6%
fma-define93.6%
clear-num93.6%
inv-pow93.6%
*-commutative93.6%
*-commutative93.6%
fma-undefine93.6%
fma-undefine93.6%
*-commutative93.6%
*-commutative93.6%
associate-*r*92.4%
fma-define93.6%
pow293.6%
Applied egg-rr93.6%
Taylor expanded in x1 around 0 72.3%
if 2.55000000000000018e153 < x1 Initial program 2.6%
Taylor expanded in x1 around 0 2.6%
Taylor expanded in x1 around inf 48.6%
Final simplification60.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.2e+45)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (or (<= x1 -3.3e-12) (not (<= x1 5e-38)))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.2e+45) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if ((x1 <= -3.3e-12) || !(x1 <= 5e-38)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.2d+45)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if ((x1 <= (-3.3d-12)) .or. (.not. (x1 <= 5d-38))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.2e+45) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if ((x1 <= -3.3e-12) || !(x1 <= 5e-38)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.2e+45: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif (x1 <= -3.3e-12) or not (x1 <= 5e-38): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.2e+45) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif ((x1 <= -3.3e-12) || !(x1 <= 5e-38)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.2e+45) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif ((x1 <= -3.3e-12) || ~((x1 <= 5e-38))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.2e+45], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -3.3e-12], N[Not[LessEqual[x1, 5e-38]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{+45}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.3 \cdot 10^{-12} \lor \neg \left(x1 \leq 5 \cdot 10^{-38}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.19999999999999995e45Initial program 15.9%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x1 around 0 2.7%
mul-1-neg2.7%
unsub-neg2.7%
*-commutative2.7%
Simplified2.7%
Taylor expanded in x2 around 0 9.4%
if -1.19999999999999995e45 < x1 < -3.3000000000000001e-12 or 5.00000000000000033e-38 < x1 Initial program 55.8%
Taylor expanded in x1 around 0 26.7%
Taylor expanded in x1 around inf 41.6%
if -3.3000000000000001e-12 < x1 < 5.00000000000000033e-38Initial program 99.5%
Taylor expanded in x2 around inf 84.0%
associate-*r/84.0%
+-commutative84.0%
unpow284.0%
fma-undefine84.0%
Simplified84.0%
Taylor expanded in x1 around 0 84.2%
Taylor expanded in x2 around 0 81.7%
+-commutative81.7%
*-commutative81.7%
associate-+l+81.7%
distribute-lft1-in81.7%
metadata-eval81.7%
mul-1-neg81.7%
sub-neg81.7%
*-commutative81.7%
Simplified81.7%
Final simplification53.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -6.2e-160) (not (<= x1 3.6e-269))) (+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0)))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.2e-160) || !(x1 <= 3.6e-269)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-6.2d-160)) .or. (.not. (x1 <= 3.6d-269))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -6.2e-160) || !(x1 <= 3.6e-269)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -6.2e-160) or not (x1 <= 3.6e-269): tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -6.2e-160) || !(x1 <= 3.6e-269)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -6.2e-160) || ~((x1 <= 3.6e-269))) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -6.2e-160], N[Not[LessEqual[x1, 3.6e-269]], $MachinePrecision]], 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], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{-160} \lor \neg \left(x1 \leq 3.6 \cdot 10^{-269}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -6.2000000000000001e-160 or 3.59999999999999998e-269 < x1 Initial program 61.4%
Taylor expanded in x1 around 0 43.3%
Taylor expanded in x1 around 0 51.0%
if -6.2000000000000001e-160 < x1 < 3.59999999999999998e-269Initial program 99.8%
Taylor expanded in x2 around inf 68.7%
associate-*r/68.7%
+-commutative68.7%
unpow268.7%
fma-undefine68.7%
Simplified68.7%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 91.0%
*-commutative91.0%
Simplified91.0%
Final simplification57.9%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.5e-16) (not (<= x1 8e-38))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.5e-16) || !(x1 <= 8e-38)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.5d-16)) .or. (.not. (x1 <= 8d-38))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.5e-16) || !(x1 <= 8e-38)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.5e-16) or not (x1 <= 8e-38): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.5e-16) || !(x1 <= 8e-38)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.5e-16) || ~((x1 <= 8e-38))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.5e-16], N[Not[LessEqual[x1, 8e-38]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.5 \cdot 10^{-16} \lor \neg \left(x1 \leq 8 \cdot 10^{-38}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -3.50000000000000017e-16 or 7.9999999999999997e-38 < x1 Initial program 41.5%
Taylor expanded in x1 around 0 17.1%
Taylor expanded in x1 around inf 26.7%
if -3.50000000000000017e-16 < x1 < 7.9999999999999997e-38Initial program 99.5%
Taylor expanded in x2 around inf 84.0%
associate-*r/84.0%
+-commutative84.0%
unpow284.0%
fma-undefine84.0%
Simplified84.0%
Taylor expanded in x1 around 0 84.2%
Taylor expanded in x2 around 0 81.7%
+-commutative81.7%
*-commutative81.7%
associate-+l+81.7%
distribute-lft1-in81.7%
metadata-eval81.7%
mul-1-neg81.7%
sub-neg81.7%
*-commutative81.7%
Simplified81.7%
Final simplification51.8%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -3.6e-178) (* x2 -6.0) (if (<= x2 3.9e-206) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -3.6e-178) {
tmp = x2 * -6.0;
} else if (x2 <= 3.9e-206) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-3.6d-178)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 3.9d-206) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -3.6e-178) {
tmp = x2 * -6.0;
} else if (x2 <= 3.9e-206) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -3.6e-178: tmp = x2 * -6.0 elif x2 <= 3.9e-206: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -3.6e-178) tmp = Float64(x2 * -6.0); elseif (x2 <= 3.9e-206) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -3.6e-178) tmp = x2 * -6.0; elseif (x2 <= 3.9e-206) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -3.6e-178], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 3.9e-206], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.6 \cdot 10^{-178}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 3.9 \cdot 10^{-206}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -3.59999999999999994e-178Initial program 57.5%
Taylor expanded in x1 around 0 36.6%
Taylor expanded in x1 around 0 30.5%
*-commutative30.5%
Simplified30.5%
Taylor expanded in x1 around 0 30.7%
if -3.59999999999999994e-178 < x2 < 3.90000000000000007e-206Initial program 71.2%
Taylor expanded in x2 around inf 54.6%
associate-*r/54.6%
+-commutative54.6%
unpow254.6%
fma-undefine54.6%
Simplified54.6%
Taylor expanded in x1 around 0 54.7%
Taylor expanded in x2 around 0 47.7%
distribute-rgt1-in47.7%
metadata-eval47.7%
mul-1-neg47.7%
Simplified47.7%
if 3.90000000000000007e-206 < x2 Initial program 77.1%
Taylor expanded in x1 around 0 55.6%
Taylor expanded in x1 around 0 37.3%
*-commutative37.3%
Simplified37.3%
Final simplification36.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -9.5e-179) (not (<= x2 3.9e-206))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -9.5e-179) || !(x2 <= 3.9e-206)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-9.5d-179)) .or. (.not. (x2 <= 3.9d-206))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -9.5e-179) || !(x2 <= 3.9e-206)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -9.5e-179) or not (x2 <= 3.9e-206): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -9.5e-179) || !(x2 <= 3.9e-206)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -9.5e-179) || ~((x2 <= 3.9e-206))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -9.5e-179], N[Not[LessEqual[x2, 3.9e-206]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -9.5 \cdot 10^{-179} \lor \neg \left(x2 \leq 3.9 \cdot 10^{-206}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -9.50000000000000037e-179 or 3.90000000000000007e-206 < x2 Initial program 67.2%
Taylor expanded in x1 around 0 46.0%
Taylor expanded in x1 around 0 33.8%
*-commutative33.8%
Simplified33.8%
Taylor expanded in x1 around 0 33.6%
if -9.50000000000000037e-179 < x2 < 3.90000000000000007e-206Initial program 71.2%
Taylor expanded in x2 around inf 54.6%
associate-*r/54.6%
+-commutative54.6%
unpow254.6%
fma-undefine54.6%
Simplified54.6%
Taylor expanded in x1 around 0 54.7%
Taylor expanded in x2 around 0 47.7%
distribute-rgt1-in47.7%
metadata-eval47.7%
mul-1-neg47.7%
Simplified47.7%
Final simplification36.3%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 68.0%
Taylor expanded in x2 around inf 48.3%
associate-*r/48.3%
+-commutative48.3%
unpow248.3%
fma-undefine48.3%
Simplified48.3%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x2 around 0 40.4%
+-commutative40.4%
*-commutative40.4%
associate-+l+40.4%
distribute-lft1-in40.4%
metadata-eval40.4%
mul-1-neg40.4%
sub-neg40.4%
*-commutative40.4%
Simplified40.4%
Final simplification40.4%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 68.0%
Taylor expanded in x2 around inf 48.3%
associate-*r/48.3%
+-commutative48.3%
unpow248.3%
fma-undefine48.3%
Simplified48.3%
Taylor expanded in x1 around 0 54.1%
Taylor expanded in x2 around 0 14.0%
distribute-rgt1-in14.0%
metadata-eval14.0%
mul-1-neg14.0%
Simplified14.0%
Final simplification14.0%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 68.0%
Taylor expanded in x1 around 0 47.7%
Taylor expanded in x1 around 0 28.5%
*-commutative28.5%
Simplified28.5%
Taylor expanded in x1 around inf 3.2%
Final simplification3.2%
herbie shell --seed 2024036
(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))))))