
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_0 (* 2.0 x2)) x1) t_2)))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* t_3 (* x1 2.0)) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- (fma x1 (* x1 3.0) (* x2 -2.0)) x1) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma (* x1 (* 2.0 t_1)) (+ t_1 -3.0) (* (* x1 x1) (fma t_1 4.0 -6.0)))
(fma (* x1 3.0) (* x1 t_1) (pow x1 3.0))))))
(- (* 6.0 (pow x1 4.0)) x1))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_0 + (2.0 * x2)) - x1) / t_2;
double tmp;
if ((x1 + ((x1 + (((t_2 * (((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((fma(x1, (x1 * 3.0), (x2 * -2.0)) - x1) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma((x1 * (2.0 * t_1)), (t_1 + -3.0), ((x1 * x1) * fma(t_1, 4.0, -6.0))), fma((x1 * 3.0), (x1 * t_1), pow(x1, 3.0)))));
} else {
tmp = (6.0 * pow(x1, 4.0)) - x1;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_2) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(x2 * -2.0)) - x1) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(Float64(x1 * Float64(2.0 * t_1)), Float64(t_1 + -3.0), Float64(Float64(x1 * x1) * fma(t_1, 4.0, -6.0))), fma(Float64(x1 * 3.0), Float64(x1 * t_1), (x1 ^ 3.0)))))); else tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); 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[(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$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(N[(x1 * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + -3.0), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(t$95$1 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * 3.0), $MachinePrecision] * N[(x1 * t$95$1), $MachinePrecision] + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_2}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(x1, x1 \cdot 3, x2 \cdot -2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1 \cdot \left(2 \cdot t\_1\right), t\_1 + -3, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(t\_1, 4, -6\right)\right), \mathsf{fma}\left(x1 \cdot 3, x1 \cdot t\_1, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\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.3%
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%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2)))
(t_4 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_5 (* (* t_4 (* x1 2.0)) (- t_4 3.0)))
(t_6 (* t_1 t_4)))
(if (<=
(+
x1
(+
(+
x1
(+ (+ (* t_2 (+ t_5 (* (* x1 x1) (- (* t_4 4.0) 6.0)))) t_6) t_0))
t_3))
INFINITY)
(+
x1
(+
t_3
(+
x1
(+
t_0
(-
t_6
(*
(+
t_5
(*
(* x1 x1)
(-
(*
4.0
(*
(fma 3.0 (pow x1 2.0) (fma 2.0 x2 (- x1)))
(/ 1.0 (fma x1 x1 1.0))))
6.0)))
(- -1.0 (* x1 x1))))))))
(- (* 6.0 (pow x1 4.0)) x1))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2);
double t_4 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_5 = (t_4 * (x1 * 2.0)) * (t_4 - 3.0);
double t_6 = t_1 * t_4;
double tmp;
if ((x1 + ((x1 + (((t_2 * (t_5 + ((x1 * x1) * ((t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (x1 + (t_0 + (t_6 - ((t_5 + ((x1 * x1) * ((4.0 * (fma(3.0, pow(x1, 2.0), fma(2.0, x2, -x1)) * (1.0 / fma(x1, x1, 1.0)))) - 6.0))) * (-1.0 - (x1 * x1)))))));
} else {
tmp = (6.0 * pow(x1, 4.0)) - x1;
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_5 = Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(t_4 - 3.0)) t_6 = Float64(t_1 * t_4) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)))) + t_6) + t_0)) + t_3)) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_0 + Float64(t_6 - Float64(Float64(t_5 + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * Float64(fma(3.0, (x1 ^ 2.0), fma(2.0, x2, Float64(-x1))) * Float64(1.0 / fma(x1, x1, 1.0)))) - 6.0))) * Float64(-1.0 - Float64(x1 * x1)))))))); else tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); 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[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$1 * t$95$4), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$0 + N[(t$95$6 - N[(N[(t$95$5 + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * N[(N[(3.0 * N[Power[x1, 2.0], $MachinePrecision] + N[(2.0 * x2 + (-x1)), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_5 := \left(t\_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_4 - 3\right)\\
t_6 := t\_1 \cdot t\_4\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right)\right) + t\_6\right) + t\_0\right)\right) + t\_3\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_0 + \left(t\_6 - \left(t\_5 + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \left(\mathsf{fma}\left(3, {x1}^{2}, \mathsf{fma}\left(2, x2, -x1\right)\right) \cdot \frac{1}{\mathsf{fma}\left(x1, x1, 1\right)}\right) - 6\right)\right) \cdot \left(-1 - x1 \cdot x1\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\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.3%
fma-define99.3%
fma-define99.3%
*-commutative99.3%
add-cbrt-cube80.7%
pow380.7%
Applied egg-rr80.7%
rem-cbrt-cube99.3%
div-sub99.3%
fma-undefine99.3%
pow299.3%
associate-*l*99.3%
div-sub99.3%
div-inv99.3%
associate--l+99.3%
associate-*l*99.3%
pow299.3%
fma-define99.3%
fma-neg99.3%
Applied egg-rr99.3%
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%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))))))
(if (<= t_3 INFINITY) t_3 (- (* 6.0 (pow x1 4.0)) x1))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (6.0 * pow(x1, 4.0)) - x1;
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (6.0 * Math.pow(x1, 4.0)) - x1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = (6.0 * math.pow(x1, 4.0)) - x1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; t_3 = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = (6.0 * (x1 ^ 4.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\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.3%
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%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -5.7e+60) (not (<= x1 5e+89)))
(- (* 6.0 (pow x1 4.0)) x1)
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 5e+89)) {
tmp = (6.0 * pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - 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) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-5.7d+60)) .or. (.not. (x1 <= 5d+89))) then
tmp = (6.0d0 * (x1 ** 4.0d0)) - x1
else
tmp = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 5e+89)) {
tmp = (6.0 * Math.pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -5.7e+60) or not (x1 <= 5e+89): tmp = (6.0 * math.pow(x1, 4.0)) - x1 else: tmp = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -5.7e+60) || !(x1 <= 5e+89)) tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -5.7e+60) || ~((x1 <= 5e+89))) tmp = (6.0 * (x1 ^ 4.0)) - x1; else tmp = x1 + ((x1 + (((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -5.7e+60], N[Not[LessEqual[x1, 5e+89]], $MachinePrecision]], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+60} \lor \neg \left(x1 \leq 5 \cdot 10^{+89}\right):\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.69999999999999978e60 or 4.99999999999999983e89 < x1 Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
mul-1-neg19.5%
unsub-neg19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
if -5.69999999999999978e60 < x1 < 4.99999999999999983e89Initial program 99.3%
Taylor expanded in x1 around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (or (<= x1 -5.7e+60) (not (<= x1 2e+98)))
(- (* 6.0 (pow x1 4.0)) x1)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_1)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 2e+98)) {
tmp = (6.0 * pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if ((x1 <= (-5.7d+60)) .or. (.not. (x1 <= 2d+98))) then
tmp = (6.0d0 * (x1 ** 4.0d0)) - x1
else
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.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 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 2e+98)) {
tmp = (6.0 * Math.pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if (x1 <= -5.7e+60) or not (x1 <= 2e+98): tmp = (6.0 * math.pow(x1, 4.0)) - x1 else: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if ((x1 <= -5.7e+60) || !(x1 <= 2e+98)) tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if ((x1 <= -5.7e+60) || ~((x1 <= 2e+98))) tmp = (6.0 * (x1 ^ 4.0)) - x1; else tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.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[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[x1, -5.7e+60], N[Not[LessEqual[x1, 2e+98]], $MachinePrecision]], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+60} \lor \neg \left(x1 \leq 2 \cdot 10^{+98}\right):\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.69999999999999978e60 or 2e98 < x1 Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
mul-1-neg19.5%
unsub-neg19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
if -5.69999999999999978e60 < x1 < 2e98Initial program 99.3%
Taylor expanded in x1 around inf 99.0%
Final simplification99.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.7e+60) (not (<= x1 4e+96)))
(- (* 6.0 (pow x1 4.0)) x1)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 4e+96)) {
tmp = (6.0 * pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5.7d+60)) .or. (.not. (x1 <= 4d+96))) then
tmp = (6.0d0 * (x1 ** 4.0d0)) - x1
else
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.7e+60) || !(x1 <= 4e+96)) {
tmp = (6.0 * Math.pow(x1, 4.0)) - x1;
} else {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5.7e+60) or not (x1 <= 4e+96): tmp = (6.0 * math.pow(x1, 4.0)) - x1 else: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.7e+60) || !(x1 <= 4e+96)) tmp = Float64(Float64(6.0 * (x1 ^ 4.0)) - x1); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.7e+60) || ~((x1 <= 4e+96))) tmp = (6.0 * (x1 ^ 4.0)) - x1; else tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.7e+60], N[Not[LessEqual[x1, 4e+96]], $MachinePrecision]], N[(N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.7 \cdot 10^{+60} \lor \neg \left(x1 \leq 4 \cdot 10^{+96}\right):\\
\;\;\;\;6 \cdot {x1}^{4} - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.69999999999999978e60 or 4.0000000000000002e96 < x1 Initial program 19.5%
Taylor expanded in x1 around 0 19.5%
mul-1-neg19.5%
unsub-neg19.5%
*-commutative19.5%
Simplified19.5%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x1 around inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
if -5.69999999999999978e60 < x1 < 4.0000000000000002e96Initial program 99.3%
Taylor expanded in x1 around 0 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x1 around inf 99.0%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (/ (- (+ t_1 (* 2.0 x2)) x1) t_0)))
(if (<= x1 -5.6e+102)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_0
(+
(* (* t_2 (* x1 2.0)) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_1))))))
(- x1 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
if (x1 <= (-5.6d+102)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_1)))))
else
tmp = x1 - (x1 * ((-1.0d0) - (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1))))) else: tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_1)))))); else tmp = Float64(x1 - Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * (((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_1))))); else tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot \left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in x1 around 0 20.2%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified20.2%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x1 around inf 99.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.8%
Final simplification80.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (+ t_0 (* 2.0 x2)) x1))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(-
(* x1 (* x1 x1))
(+
(* t_0 (/ t_1 (- -1.0 (* x1 x1))))
(*
t_2
(- (* (* x1 x1) (- 6.0 (* (/ t_1 t_2) 4.0))) (* x1 2.0)))))))))
(t_4
(+
x1
(- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))))
(if (<= x1 -5.6e+102)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 -5000000000.0)
t_3
(if (<= x1 -4.1e-154)
t_4
(if (<= x1 5.2e-230)
(- (* x2 -6.0) x1)
(if (<= x1 242000.0)
t_4
(if (<= x1 1.35e+154)
t_3
(- x1 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * (t_1 / (-1.0 - (x1 * x1)))) + (t_2 * (((x1 * x1) * (6.0 - ((t_1 / t_2) * 4.0))) - (x1 * 2.0)))))));
double t_4 = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -5000000000.0) {
tmp = t_3;
} else if (x1 <= -4.1e-154) {
tmp = t_4;
} else if (x1 <= 5.2e-230) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 242000.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (t_0 + (2.0d0 * x2)) - x1
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * (t_1 / ((-1.0d0) - (x1 * x1)))) + (t_2 * (((x1 * x1) * (6.0d0 - ((t_1 / t_2) * 4.0d0))) - (x1 * 2.0d0)))))))
t_4 = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= (-5000000000.0d0)) then
tmp = t_3
else if (x1 <= (-4.1d-154)) then
tmp = t_4
else if (x1 <= 5.2d-230) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 242000.0d0) then
tmp = t_4
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = x1 - (x1 * ((-1.0d0) - (4.0d0 * (x2 * ((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 = (t_0 + (2.0 * x2)) - x1;
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * (t_1 / (-1.0 - (x1 * x1)))) + (t_2 * (((x1 * x1) * (6.0 - ((t_1 / t_2) * 4.0))) - (x1 * 2.0)))))));
double t_4 = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -5000000000.0) {
tmp = t_3;
} else if (x1 <= -4.1e-154) {
tmp = t_4;
} else if (x1 <= 5.2e-230) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 242000.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (t_0 + (2.0 * x2)) - x1 t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * (t_1 / (-1.0 - (x1 * x1)))) + (t_2 * (((x1 * x1) * (6.0 - ((t_1 / t_2) * 4.0))) - (x1 * 2.0))))))) t_4 = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= -5000000000.0: tmp = t_3 elif x1 <= -4.1e-154: tmp = t_4 elif x1 <= 5.2e-230: tmp = (x2 * -6.0) - x1 elif x1 <= 242000.0: tmp = t_4 elif x1 <= 1.35e+154: tmp = t_3 else: tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_0 * Float64(t_1 / Float64(-1.0 - Float64(x1 * x1)))) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(Float64(t_1 / t_2) * 4.0))) - Float64(x1 * 2.0)))))))) t_4 = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= -5000000000.0) tmp = t_3; elseif (x1 <= -4.1e-154) tmp = t_4; elseif (x1 <= 5.2e-230) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 242000.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(x1 - Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * 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 = (t_0 + (2.0 * x2)) - x1; t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * (t_1 / (-1.0 - (x1 * x1)))) + (t_2 * (((x1 * x1) * (6.0 - ((t_1 / t_2) * 4.0))) - (x1 * 2.0))))))); t_4 = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= -5000000000.0) tmp = t_3; elseif (x1 <= -4.1e-154) tmp = t_4; elseif (x1 <= 5.2e-230) tmp = (x2 * -6.0) - x1; elseif (x1 <= 242000.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$0 * N[(t$95$1 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(N[(t$95$1 / t$95$2), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -5000000000.0], t$95$3, If[LessEqual[x1, -4.1e-154], t$95$4, If[LessEqual[x1, 5.2e-230], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 242000.0], t$95$4, If[LessEqual[x1, 1.35e+154], t$95$3, 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]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_0 \cdot \frac{t\_1}{-1 - x1 \cdot x1} + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{t\_1}{t\_2} \cdot 4\right) - x1 \cdot 2\right)\right)\right)\right)\right)\\
t_4 := x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -5000000000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq -4.1 \cdot 10^{-154}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{-230}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 242000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in x1 around 0 20.2%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified20.2%
if -5.60000000000000037e102 < x1 < -5e9 or 242000 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around 0 83.8%
+-commutative83.8%
mul-1-neg83.8%
unsub-neg83.8%
Simplified83.8%
Taylor expanded in x1 around inf 85.7%
*-commutative85.7%
Simplified85.7%
if -5e9 < x1 < -4.1e-154 or 5.2000000000000003e-230 < x1 < 242000Initial program 99.4%
Taylor expanded in x1 around 0 94.0%
Taylor expanded in x1 around 0 94.4%
if -4.1e-154 < x1 < 5.2000000000000003e-230Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around inf 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x1 around 0 91.6%
*-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
*-commutative91.6%
Simplified91.6%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.8%
Final simplification75.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 (- -1.0 (* x1 x1)))))
(if (<= x1 -5.6e+102)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(-
x1
(-
(+
(* t_1 t_3)
(*
t_0
(- (* (- (/ t_2 t_0) 3.0) (* (* x1 2.0) t_3)) (* (* x1 x1) 6.0))))
(* x1 (* x1 x1))))))
(- x1 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / (-1.0 - (x1 * x1));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_1 * t_3) + (t_0 * ((((t_2 / t_0) - 3.0) * ((x1 * 2.0) * t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (t_1 + (2.0d0 * x2)) - x1
t_3 = t_2 / ((-1.0d0) - (x1 * x1))
if (x1 <= (-5.6d+102)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 - (((t_1 * t_3) + (t_0 * ((((t_2 / t_0) - 3.0d0) * ((x1 * 2.0d0) * t_3)) - ((x1 * x1) * 6.0d0)))) - (x1 * (x1 * x1)))))
else
tmp = x1 - (x1 * ((-1.0d0) - (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / (-1.0 - (x1 * x1));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_1 * t_3) + (t_0 * ((((t_2 / t_0) - 3.0) * ((x1 * 2.0) * t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = t_2 / (-1.0 - (x1 * x1)) tmp = 0 if x1 <= -5.6e+102: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_1 * t_3) + (t_0 * ((((t_2 / t_0) - 3.0) * ((x1 * 2.0) * t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))))) else: tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / Float64(-1.0 - Float64(x1 * x1))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 - Float64(Float64(Float64(t_1 * t_3) + Float64(t_0 * Float64(Float64(Float64(Float64(t_2 / t_0) - 3.0) * Float64(Float64(x1 * 2.0) * t_3)) - Float64(Float64(x1 * x1) * 6.0)))) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 - Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = t_2 / (-1.0 - (x1 * x1)); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_1 * t_3) + (t_0 * ((((t_2 / t_0) - 3.0) * ((x1 * 2.0) * t_3)) - ((x1 * x1) * 6.0)))) - (x1 * (x1 * x1))))); else tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(t$95$2 / t$95$0), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{-1 - x1 \cdot x1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 - \left(\left(t\_1 \cdot t\_3 + t\_0 \cdot \left(\left(\frac{t\_2}{t\_0} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot t\_3\right) - \left(x1 \cdot x1\right) \cdot 6\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in x1 around 0 20.2%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified20.2%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x1 around inf 97.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.8%
Final simplification79.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (+ t_0 (* 2.0 x2)) x1))
(t_2 (+ (* x1 x1) 1.0)))
(if (<= x1 -5.6e+102)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(-
x1
(-
(-
(*
t_2
(-
(* (- (/ t_1 t_2) 3.0) (* (* x1 2.0) (/ t_1 (- -1.0 (* x1 x1)))))
(* (* x1 x1) 6.0)))
(* 3.0 t_0))
(* x1 (* x1 x1))))))
(- x1 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((((t_1 / t_2) - 3.0) * ((x1 * 2.0) * (t_1 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_0)) - (x1 * (x1 * x1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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 = (t_0 + (2.0d0 * x2)) - x1
t_2 = (x1 * x1) + 1.0d0
if (x1 <= (-5.6d+102)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 - (((t_2 * ((((t_1 / t_2) - 3.0d0) * ((x1 * 2.0d0) * (t_1 / ((-1.0d0) - (x1 * x1))))) - ((x1 * x1) * 6.0d0))) - (3.0d0 * t_0)) - (x1 * (x1 * x1)))))
else
tmp = x1 - (x1 * ((-1.0d0) - (4.0d0 * (x2 * ((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 = (t_0 + (2.0 * x2)) - x1;
double t_2 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((((t_1 / t_2) - 3.0) * ((x1 * 2.0) * (t_1 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_0)) - (x1 * (x1 * x1)))));
} else {
tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (t_0 + (2.0 * x2)) - x1 t_2 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -5.6e+102: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((((t_1 / t_2) - 3.0) * ((x1 * 2.0) * (t_1 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_0)) - (x1 * (x1 * x1))))) else: tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) t_2 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 - Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(t_1 / t_2) - 3.0) * Float64(Float64(x1 * 2.0) * Float64(t_1 / Float64(-1.0 - Float64(x1 * x1))))) - Float64(Float64(x1 * x1) * 6.0))) - Float64(3.0 * t_0)) - Float64(x1 * Float64(x1 * x1)))))); else tmp = Float64(x1 - Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * 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 = (t_0 + (2.0 * x2)) - x1; t_2 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((((t_1 / t_2) - 3.0) * ((x1 * 2.0) * (t_1 / (-1.0 - (x1 * x1))))) - ((x1 * x1) * 6.0))) - (3.0 * t_0)) - (x1 * (x1 * x1))))); else tmp = x1 - (x1 * (-1.0 - (4.0 * (x2 * ((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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$2 * N[(N[(N[(N[(t$95$1 / t$95$2), $MachinePrecision] - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(t$95$1 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_2 := x1 \cdot x1 + 1\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 - \left(\left(t\_2 \cdot \left(\left(\frac{t\_1}{t\_2} - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \frac{t\_1}{-1 - x1 \cdot x1}\right) - \left(x1 \cdot x1\right) \cdot 6\right) - 3 \cdot t\_0\right) - x1 \cdot \left(x1 \cdot x1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 - x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.2%
*-commutative3.2%
Simplified3.2%
Taylor expanded in x1 around 0 20.2%
mul-1-neg0.0%
unsub-neg0.0%
*-commutative0.0%
Simplified20.2%
if -5.60000000000000037e102 < x1 < 1.35000000000000003e154Initial program 99.3%
Taylor expanded in x1 around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x1 around inf 97.7%
Taylor expanded in x1 around inf 97.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 45.8%
Final simplification79.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x2 (- 3.0 (* 2.0 x2)))))
(if (<= x1 -6.2e+74)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (<= x1 -3.1e-155)
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 t_2)))))
(if (<= x1 1.22e-206)
(- (* x2 -6.0) x1)
(if (<= x1 4.3e+142)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
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 (* 4.0 (* x2 (- (* 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 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -6.2e+74) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -3.1e-155) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_2))));
} else if (x1 <= 1.22e-206) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.3e+142) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (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 - (4.0 * (x2 * ((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 = x2 * (3.0d0 - (2.0d0 * x2))
if (x1 <= (-6.2d+74)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if (x1 <= (-3.1d-155)) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * t_2))))
else if (x1 <= 1.22d-206) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.3d+142) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (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) - (4.0d0 * (x2 * ((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 = x2 * (3.0 - (2.0 * x2));
double tmp;
if (x1 <= -6.2e+74) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if (x1 <= -3.1e-155) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_2))));
} else if (x1 <= 1.22e-206) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.3e+142) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (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 - (4.0 * (x2 * ((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 = x2 * (3.0 - (2.0 * x2)) tmp = 0 if x1 <= -6.2e+74: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif x1 <= -3.1e-155: tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_2)))) elif x1 <= 1.22e-206: tmp = (x2 * -6.0) - x1 elif x1 <= 4.3e+142: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (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 - (4.0 * (x2 * ((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(x2 * Float64(3.0 - Float64(2.0 * x2))) tmp = 0.0 if (x1 <= -6.2e+74) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif (x1 <= -3.1e-155) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * t_2))))); elseif (x1 <= 1.22e-206) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.3e+142) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + 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 - Float64(4.0 * Float64(x2 * 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 = x2 * (3.0 - (2.0 * x2)); tmp = 0.0; if (x1 <= -6.2e+74) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif (x1 <= -3.1e-155) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * t_2)))); elseif (x1 <= 1.22e-206) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.3e+142) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (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 - (4.0 * (x2 * ((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[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.2e+74], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3.1e-155], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.22e-206], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.3e+142], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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 - N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x2 \cdot \left(3 - 2 \cdot x2\right)\\
\mathbf{if}\;x1 \leq -6.2 \cdot 10^{+74}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3.1 \cdot 10^{-155}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot t\_2\right)\right)\\
\mathbf{elif}\;x1 \leq 1.22 \cdot 10^{-206}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.3 \cdot 10^{+142}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \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 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -6.20000000000000043e74Initial program 5.2%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.1%
*-commutative3.1%
Simplified3.1%
Taylor expanded in x1 around 0 19.4%
mul-1-neg5.2%
unsub-neg5.2%
*-commutative5.2%
Simplified19.4%
if -6.20000000000000043e74 < x1 < -3.1e-155Initial program 99.2%
Taylor expanded in x1 around 0 71.4%
Taylor expanded in x1 around 0 72.3%
if -3.1e-155 < x1 < 1.22000000000000002e-206Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around inf 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x1 around 0 91.8%
*-commutative91.8%
mul-1-neg91.8%
unsub-neg91.8%
*-commutative91.8%
Simplified91.8%
if 1.22000000000000002e-206 < x1 < 4.30000000000000012e142Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around 0 79.4%
if 4.30000000000000012e142 < x1 Initial program 8.1%
Taylor expanded in x1 around 0 0.4%
Taylor expanded in x1 around inf 42.5%
Final simplification66.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x2 -9.5e+62)
(+ x1 (- 9.0 t_0))
(if (<= x2 2.55e+100)
(- (* x2 -6.0) x1)
(if (or (<= x2 3.9e+167) (not (<= x2 2.2e+192)))
(- x1 t_0)
(+ x1 (+ (+ x1 (* 4.0 (* -3.0 (* x1 x2)))) (* 3.0 (* x2 -2.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -9.5e+62) {
tmp = x1 + (9.0 - t_0);
} else if (x2 <= 2.55e+100) {
tmp = (x2 * -6.0) - x1;
} else if ((x2 <= 3.9e+167) || !(x2 <= 2.2e+192)) {
tmp = x1 - t_0;
} else {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((-1.0d0) - (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x2 <= (-9.5d+62)) then
tmp = x1 + (9.0d0 - t_0)
else if (x2 <= 2.55d+100) then
tmp = (x2 * (-6.0d0)) - x1
else if ((x2 <= 3.9d+167) .or. (.not. (x2 <= 2.2d+192))) then
tmp = x1 - t_0
else
tmp = x1 + ((x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))) + (3.0d0 * (x2 * (-2.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -9.5e+62) {
tmp = x1 + (9.0 - t_0);
} else if (x2 <= 2.55e+100) {
tmp = (x2 * -6.0) - x1;
} else if ((x2 <= 3.9e+167) || !(x2 <= 2.2e+192)) {
tmp = x1 - t_0;
} else {
tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x2 <= -9.5e+62: tmp = x1 + (9.0 - t_0) elif x2 <= 2.55e+100: tmp = (x2 * -6.0) - x1 elif (x2 <= 3.9e+167) or not (x2 <= 2.2e+192): tmp = x1 - t_0 else: tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x2 <= -9.5e+62) tmp = Float64(x1 + Float64(9.0 - t_0)); elseif (x2 <= 2.55e+100) tmp = Float64(Float64(x2 * -6.0) - x1); elseif ((x2 <= 3.9e+167) || !(x2 <= 2.2e+192)) tmp = Float64(x1 - t_0); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x2 <= -9.5e+62) tmp = x1 + (9.0 - t_0); elseif (x2 <= 2.55e+100) tmp = (x2 * -6.0) - x1; elseif ((x2 <= 3.9e+167) || ~((x2 <= 2.2e+192))) tmp = x1 - t_0; else tmp = x1 + ((x1 + (4.0 * (-3.0 * (x1 * x2)))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 - N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -9.5e+62], N[(x1 + N[(9.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 2.55e+100], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[Or[LessEqual[x2, 3.9e+167], N[Not[LessEqual[x2, 2.2e+192]], $MachinePrecision]], N[(x1 - t$95$0), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x2 \leq -9.5 \cdot 10^{+62}:\\
\;\;\;\;x1 + \left(9 - t\_0\right)\\
\mathbf{elif}\;x2 \leq 2.55 \cdot 10^{+100}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x2 \leq 3.9 \cdot 10^{+167} \lor \neg \left(x2 \leq 2.2 \cdot 10^{+192}\right):\\
\;\;\;\;x1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if x2 < -9.5000000000000003e62Initial program 66.4%
Taylor expanded in x1 around 0 41.9%
Taylor expanded in x1 around inf 53.6%
if -9.5000000000000003e62 < x2 < 2.55000000000000005e100Initial program 72.1%
Taylor expanded in x1 around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x1 around inf 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x1 around 0 52.0%
*-commutative52.0%
mul-1-neg52.0%
unsub-neg52.0%
*-commutative52.0%
Simplified52.0%
if 2.55000000000000005e100 < x2 < 3.8999999999999998e167 or 2.2000000000000001e192 < x2 Initial program 82.5%
Taylor expanded in x1 around 0 70.8%
Taylor expanded in x1 around inf 76.7%
if 3.8999999999999998e167 < x2 < 2.2000000000000001e192Initial program 39.7%
Taylor expanded in x1 around 0 1.1%
Taylor expanded in x2 around 0 21.5%
*-commutative21.5%
Simplified21.5%
Taylor expanded in x1 around 0 81.5%
*-commutative81.5%
Simplified81.5%
Final simplification56.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.2e+126)
(+ x1 (* x1 (+ (* x2 -12.0) 1.0)))
(if (or (<= x1 -3.1e-155) (not (<= x1 5.5e-222)))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.2e+126) {
tmp = x1 + (x1 * ((x2 * -12.0) + 1.0));
} else if ((x1 <= -3.1e-155) || !(x1 <= 5.5e-222)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} 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+126)) then
tmp = x1 + (x1 * ((x2 * (-12.0d0)) + 1.0d0))
else if ((x1 <= (-3.1d-155)) .or. (.not. (x1 <= 5.5d-222))) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))))
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+126) {
tmp = x1 + (x1 * ((x2 * -12.0) + 1.0));
} else if ((x1 <= -3.1e-155) || !(x1 <= 5.5e-222)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.2e+126: tmp = x1 + (x1 * ((x2 * -12.0) + 1.0)) elif (x1 <= -3.1e-155) or not (x1 <= 5.5e-222): tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.2e+126) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * -12.0) + 1.0))); elseif ((x1 <= -3.1e-155) || !(x1 <= 5.5e-222)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))))); 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+126) tmp = x1 + (x1 * ((x2 * -12.0) + 1.0)); elseif ((x1 <= -3.1e-155) || ~((x1 <= 5.5e-222))) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.2e+126], N[(x1 + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -3.1e-155], N[Not[LessEqual[x1, 5.5e-222]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $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^{+126}:\\
\;\;\;\;x1 + x1 \cdot \left(x2 \cdot -12 + 1\right)\\
\mathbf{elif}\;x1 \leq -3.1 \cdot 10^{-155} \lor \neg \left(x1 \leq 5.5 \cdot 10^{-222}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.20000000000000006e126Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 3.6%
*-commutative3.6%
Simplified3.6%
Taylor expanded in x1 around inf 19.8%
*-commutative19.8%
Simplified19.8%
if -1.20000000000000006e126 < x1 < -3.1e-155 or 5.50000000000000003e-222 < x1 Initial program 77.2%
Taylor expanded in x1 around 0 53.9%
Taylor expanded in x1 around 0 62.2%
if -3.1e-155 < x1 < 5.50000000000000003e-222Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around inf 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x1 around 0 91.6%
*-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
*-commutative91.6%
Simplified91.6%
Final simplification62.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4.6e+74)
(- x1 (- (* 3.0 (- x1 (* x2 -2.0))) (+ x1 (* 4.0 (* -3.0 (* x1 x2))))))
(if (or (<= x1 -4.1e-154) (not (<= x1 2e-229)))
(+ x1 (- (* x2 -6.0) (* x1 (+ 2.0 (* 4.0 (* x2 (- 3.0 (* 2.0 x2))))))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.6e+74) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if ((x1 <= -4.1e-154) || !(x1 <= 2e-229)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} 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 <= (-4.6d+74)) then
tmp = x1 - ((3.0d0 * (x1 - (x2 * (-2.0d0)))) - (x1 + (4.0d0 * ((-3.0d0) * (x1 * x2)))))
else if ((x1 <= (-4.1d-154)) .or. (.not. (x1 <= 2d-229))) then
tmp = x1 + ((x2 * (-6.0d0)) - (x1 * (2.0d0 + (4.0d0 * (x2 * (3.0d0 - (2.0d0 * x2)))))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.6e+74) {
tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2)))));
} else if ((x1 <= -4.1e-154) || !(x1 <= 2e-229)) {
tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2)))))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.6e+74: tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))) elif (x1 <= -4.1e-154) or not (x1 <= 2e-229): tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.6e+74) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))) - Float64(x1 + Float64(4.0 * Float64(-3.0 * Float64(x1 * x2)))))); elseif ((x1 <= -4.1e-154) || !(x1 <= 2e-229)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2)))))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.6e+74) tmp = x1 - ((3.0 * (x1 - (x2 * -2.0))) - (x1 + (4.0 * (-3.0 * (x1 * x2))))); elseif ((x1 <= -4.1e-154) || ~((x1 <= 2e-229))) tmp = x1 + ((x2 * -6.0) - (x1 * (2.0 + (4.0 * (x2 * (3.0 - (2.0 * x2))))))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.6e+74], N[(x1 - N[(N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 + N[(4.0 * N[(-3.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -4.1e-154], N[Not[LessEqual[x1, 2e-229]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.6 \cdot 10^{+74}:\\
\;\;\;\;x1 - \left(3 \cdot \left(x1 - x2 \cdot -2\right) - \left(x1 + 4 \cdot \left(-3 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -4.1 \cdot 10^{-154} \lor \neg \left(x1 \leq 2 \cdot 10^{-229}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 - x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -4.5999999999999997e74Initial program 5.2%
Taylor expanded in x1 around 0 0.1%
Taylor expanded in x2 around 0 3.1%
*-commutative3.1%
Simplified3.1%
Taylor expanded in x1 around 0 19.4%
mul-1-neg5.2%
unsub-neg5.2%
*-commutative5.2%
Simplified19.4%
if -4.5999999999999997e74 < x1 < -4.1e-154 or 2.00000000000000014e-229 < x1 Initial program 79.2%
Taylor expanded in x1 around 0 56.1%
Taylor expanded in x1 around 0 64.7%
if -4.1e-154 < x1 < 2.00000000000000014e-229Initial program 99.3%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x1 around inf 91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x1 around 0 91.6%
*-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
*-commutative91.6%
Simplified91.6%
Final simplification63.2%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -7e+62) (not (<= x2 3.8e+100))) (- 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 ((x2 <= -7e+62) || !(x2 <= 3.8e+100)) {
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 ((x2 <= (-7d+62)) .or. (.not. (x2 <= 3.8d+100))) 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 ((x2 <= -7e+62) || !(x2 <= 3.8e+100)) {
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 (x2 <= -7e+62) or not (x2 <= 3.8e+100): 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 ((x2 <= -7e+62) || !(x2 <= 3.8e+100)) 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 ((x2 <= -7e+62) || ~((x2 <= 3.8e+100))) 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[x2, -7e+62], N[Not[LessEqual[x2, 3.8e+100]], $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}\;x2 \leq -7 \cdot 10^{+62} \lor \neg \left(x2 \leq 3.8 \cdot 10^{+100}\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 x2 < -6.99999999999999967e62 or 3.79999999999999963e100 < x2 Initial program 72.3%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x1 around inf 61.1%
if -6.99999999999999967e62 < x2 < 3.79999999999999963e100Initial program 72.1%
Taylor expanded in x1 around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x1 around inf 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x1 around 0 52.0%
*-commutative52.0%
mul-1-neg52.0%
unsub-neg52.0%
*-commutative52.0%
Simplified52.0%
Final simplification55.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x2 -1e+63)
(+ x1 (- 9.0 t_0))
(if (<= x2 6e+100) (- (* x2 -6.0) x1) (- x1 t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -1e+63) {
tmp = x1 + (9.0 - t_0);
} else if (x2 <= 6e+100) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 - 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) :: tmp
t_0 = x1 * ((-1.0d0) - (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x2 <= (-1d+63)) then
tmp = x1 + (9.0d0 - t_0)
else if (x2 <= 6d+100) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 - t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x2 <= -1e+63) {
tmp = x1 + (9.0 - t_0);
} else if (x2 <= 6e+100) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 - t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x2 <= -1e+63: tmp = x1 + (9.0 - t_0) elif x2 <= 6e+100: tmp = (x2 * -6.0) - x1 else: tmp = x1 - t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 - Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x2 <= -1e+63) tmp = Float64(x1 + Float64(9.0 - t_0)); elseif (x2 <= 6e+100) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 - t_0); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 - (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x2 <= -1e+63) tmp = x1 + (9.0 - t_0); elseif (x2 <= 6e+100) tmp = (x2 * -6.0) - x1; else tmp = x1 - t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 - N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x2, -1e+63], N[(x1 + N[(9.0 - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x2, 6e+100], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 - 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x2 \leq -1 \cdot 10^{+63}:\\
\;\;\;\;x1 + \left(9 - t\_0\right)\\
\mathbf{elif}\;x2 \leq 6 \cdot 10^{+100}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 - t\_0\\
\end{array}
\end{array}
if x2 < -1.00000000000000006e63Initial program 66.4%
Taylor expanded in x1 around 0 41.9%
Taylor expanded in x1 around inf 53.6%
if -1.00000000000000006e63 < x2 < 5.99999999999999971e100Initial program 72.1%
Taylor expanded in x1 around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x1 around inf 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x1 around 0 52.0%
*-commutative52.0%
mul-1-neg52.0%
unsub-neg52.0%
*-commutative52.0%
Simplified52.0%
if 5.99999999999999971e100 < x2 Initial program 77.7%
Taylor expanded in x1 around 0 63.0%
Taylor expanded in x1 around inf 68.3%
Final simplification55.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x2 -12.0) 1.0))))
(if (<= x1 -1.6e+126)
(+ x1 t_0)
(if (<= x1 2e-29) (- (* x2 -6.0) x1) (+ x1 (+ t_0 9.0))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + 1.0);
double tmp;
if (x1 <= -1.6e+126) {
tmp = x1 + t_0;
} else if (x1 <= 2e-29) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (t_0 + 9.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x2 * (-12.0d0)) + 1.0d0)
if (x1 <= (-1.6d+126)) then
tmp = x1 + t_0
else if (x1 <= 2d-29) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x1 + (t_0 + 9.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x2 * -12.0) + 1.0);
double tmp;
if (x1 <= -1.6e+126) {
tmp = x1 + t_0;
} else if (x1 <= 2e-29) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x1 + (t_0 + 9.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x2 * -12.0) + 1.0) tmp = 0 if x1 <= -1.6e+126: tmp = x1 + t_0 elif x1 <= 2e-29: tmp = (x2 * -6.0) - x1 else: tmp = x1 + (t_0 + 9.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x2 * -12.0) + 1.0)) tmp = 0.0 if (x1 <= -1.6e+126) tmp = Float64(x1 + t_0); elseif (x1 <= 2e-29) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x1 + Float64(t_0 + 9.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x2 * -12.0) + 1.0); tmp = 0.0; if (x1 <= -1.6e+126) tmp = x1 + t_0; elseif (x1 <= 2e-29) tmp = (x2 * -6.0) - x1; else tmp = x1 + (t_0 + 9.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.6e+126], N[(x1 + t$95$0), $MachinePrecision], If[LessEqual[x1, 2e-29], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x1 + N[(t$95$0 + 9.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x2 \cdot -12 + 1\right)\\
\mathbf{if}\;x1 \leq -1.6 \cdot 10^{+126}:\\
\;\;\;\;x1 + t\_0\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{-29}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(t\_0 + 9\right)\\
\end{array}
\end{array}
if x1 < -1.5999999999999999e126Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 3.6%
*-commutative3.6%
Simplified3.6%
Taylor expanded in x1 around inf 19.8%
*-commutative19.8%
Simplified19.8%
if -1.5999999999999999e126 < x1 < 1.99999999999999989e-29Initial program 96.1%
Taylor expanded in x1 around 0 95.8%
mul-1-neg95.8%
unsub-neg95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x1 around inf 73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in x1 around 0 62.4%
*-commutative62.4%
mul-1-neg62.4%
unsub-neg62.4%
*-commutative62.4%
Simplified62.4%
if 1.99999999999999989e-29 < x1 Initial program 50.5%
Taylor expanded in x1 around 0 17.7%
Taylor expanded in x2 around 0 4.3%
*-commutative4.3%
Simplified4.3%
Taylor expanded in x1 around inf 15.4%
+-commutative15.4%
*-commutative15.4%
Simplified15.4%
Final simplification44.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.15e+126) (not (<= x1 2e-29))) (+ x1 (* x1 (+ (* x2 -12.0) 1.0))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.15e+126) || !(x1 <= 2e-29)) {
tmp = x1 + (x1 * ((x2 * -12.0) + 1.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.15d+126)) .or. (.not. (x1 <= 2d-29))) then
tmp = x1 + (x1 * ((x2 * (-12.0d0)) + 1.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.15e+126) || !(x1 <= 2e-29)) {
tmp = x1 + (x1 * ((x2 * -12.0) + 1.0));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.15e+126) or not (x1 <= 2e-29): tmp = x1 + (x1 * ((x2 * -12.0) + 1.0)) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.15e+126) || !(x1 <= 2e-29)) tmp = Float64(x1 + Float64(x1 * Float64(Float64(x2 * -12.0) + 1.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.15e+126) || ~((x1 <= 2e-29))) tmp = x1 + (x1 * ((x2 * -12.0) + 1.0)); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.15e+126], N[Not[LessEqual[x1, 2e-29]], $MachinePrecision]], N[(x1 + N[(x1 * N[(N[(x2 * -12.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{+126} \lor \neg \left(x1 \leq 2 \cdot 10^{-29}\right):\\
\;\;\;\;x1 + x1 \cdot \left(x2 \cdot -12 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.15e126 or 1.99999999999999989e-29 < x1 Initial program 34.8%
Taylor expanded in x1 around 0 12.2%
Taylor expanded in x2 around 0 4.1%
*-commutative4.1%
Simplified4.1%
Taylor expanded in x1 around inf 16.8%
*-commutative16.8%
Simplified16.8%
if -1.15e126 < x1 < 1.99999999999999989e-29Initial program 96.1%
Taylor expanded in x1 around 0 95.8%
mul-1-neg95.8%
unsub-neg95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in x1 around inf 73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in x1 around 0 62.4%
*-commutative62.4%
mul-1-neg62.4%
unsub-neg62.4%
*-commutative62.4%
Simplified62.4%
Final simplification44.6%
(FPCore (x1 x2) :precision binary64 (+ x1 (* x2 -6.0)))
double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return x1 + (x2 * -6.0);
}
def code(x1, x2): return x1 + (x2 * -6.0)
function code(x1, x2) return Float64(x1 + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = x1 + (x2 * -6.0); end
code[x1_, x2_] := N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + x2 \cdot -6
\end{array}
Initial program 72.2%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x1 around 0 25.4%
*-commutative25.4%
Simplified25.4%
Final simplification25.4%
(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 72.2%
Taylor expanded in x1 around 0 72.0%
mul-1-neg72.0%
unsub-neg72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in x1 around inf 80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in x1 around 0 39.1%
*-commutative39.1%
mul-1-neg39.1%
unsub-neg39.1%
*-commutative39.1%
Simplified39.1%
Final simplification39.1%
(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 72.2%
Taylor expanded in x1 around 0 52.9%
Taylor expanded in x1 around 0 25.4%
*-commutative25.4%
Simplified25.4%
Taylor expanded in x1 around inf 3.6%
Final simplification3.6%
herbie shell --seed 2024046
(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))))))