
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = 6.0 * Math.pow(x1, 4.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = 6.0 * math.pow(x1, 4.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = 6.0 * (x1 ^ 4.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(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 -4e+61) (not (<= x1 1.5e+71)))
(* 6.0 (pow x1 4.0))
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -4e+61) || !(x1 <= 1.5e+71)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (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 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-4d+61)) .or. (.not. (x1 <= 1.5d+71))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (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 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -4e+61) || !(x1 <= 1.5e+71)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -4e+61) or not (x1 <= 1.5e+71): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -4e+61) || !(x1 <= 1.5e+71)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -4e+61) || ~((x1 <= 1.5e+71))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -4e+61], N[Not[LessEqual[x1, 1.5e+71]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $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 -4 \cdot 10^{+61} \lor \neg \left(x1 \leq 1.5 \cdot 10^{+71}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -3.9999999999999998e61 or 1.50000000000000006e71 < x1 Initial program 25.4%
Simplified25.4%
Taylor expanded in x1 around inf 25.4%
Taylor expanded in x1 around inf 100.0%
if -3.9999999999999998e61 < x1 < 1.50000000000000006e71Initial program 99.3%
Taylor expanded in x1 around inf 98.2%
Taylor expanded in x1 around 0 99.3%
mul-1-neg99.3%
unsub-neg99.3%
*-commutative99.3%
Simplified99.3%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* (* x1 2.0) 3.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0)))
(t_5 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_6 (* (* x1 x1) (- (* t_5 4.0) 6.0))))
(if (<= x1 -5.5e+102)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -40.0)
(+
x1
(+
t_4
(+ x1 (+ t_2 (+ (* 3.0 t_3) (* t_0 (+ t_6 (* (- t_5 3.0) t_1))))))))
(if (<= x1 0.17)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5e+153)
(+
x1
(+ t_4 (+ x1 (+ t_2 (+ (* t_3 t_5) (* t_0 (+ t_6 (* t_1 0.0))))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = (x1 * 2.0) * 3.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0);
double t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.5e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -40.0) {
tmp = x1 + (t_4 + (x1 + (t_2 + ((3.0 * t_3) + (t_0 * (t_6 + ((t_5 - 3.0) * t_1)))))));
} else if (x1 <= 0.17) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = x1 + (t_4 + (x1 + (t_2 + ((t_3 * t_5) + (t_0 * (t_6 + (t_1 * 0.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (x1 * 2.0d0) * 3.0d0
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = 3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)
t_5 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_6 = (x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)
if (x1 <= (-5.5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-40.0d0)) then
tmp = x1 + (t_4 + (x1 + (t_2 + ((3.0d0 * t_3) + (t_0 * (t_6 + ((t_5 - 3.0d0) * t_1)))))))
else if (x1 <= 0.17d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5d+153) then
tmp = x1 + (t_4 + (x1 + (t_2 + ((t_3 * t_5) + (t_0 * (t_6 + (t_1 * 0.0d0)))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.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 * 2.0) * 3.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0);
double t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0);
double tmp;
if (x1 <= -5.5e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -40.0) {
tmp = x1 + (t_4 + (x1 + (t_2 + ((3.0 * t_3) + (t_0 * (t_6 + ((t_5 - 3.0) * t_1)))))));
} else if (x1 <= 0.17) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = x1 + (t_4 + (x1 + (t_2 + ((t_3 * t_5) + (t_0 * (t_6 + (t_1 * 0.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = (x1 * 2.0) * 3.0 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0) t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0) tmp = 0 if x1 <= -5.5e+102: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -40.0: tmp = x1 + (t_4 + (x1 + (t_2 + ((3.0 * t_3) + (t_0 * (t_6 + ((t_5 - 3.0) * t_1))))))) elif x1 <= 0.17: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5e+153: tmp = x1 + (t_4 + (x1 + (t_2 + ((t_3 * t_5) + (t_0 * (t_6 + (t_1 * 0.0))))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(Float64(x1 * 2.0) * 3.0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) t_5 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_6 = Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) tmp = 0.0 if (x1 <= -5.5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -40.0) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_2 + Float64(Float64(3.0 * t_3) + Float64(t_0 * Float64(t_6 + Float64(Float64(t_5 - 3.0) * t_1)))))))); elseif (x1 <= 0.17) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(t_4 + Float64(x1 + Float64(t_2 + Float64(Float64(t_3 * t_5) + Float64(t_0 * Float64(t_6 + Float64(t_1 * 0.0)))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = (x1 * 2.0) * 3.0; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = 3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0); t_5 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_6 = (x1 * x1) * ((t_5 * 4.0) - 6.0); tmp = 0.0; if (x1 <= -5.5e+102) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -40.0) tmp = x1 + (t_4 + (x1 + (t_2 + ((3.0 * t_3) + (t_0 * (t_6 + ((t_5 - 3.0) * t_1))))))); elseif (x1 <= 0.17) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5e+153) tmp = x1 + (t_4 + (x1 + (t_2 + ((t_3 * t_5) + (t_0 * (t_6 + (t_1 * 0.0))))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -40.0], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$2 + N[(N[(3.0 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(t$95$6 + N[(N[(t$95$5 - 3.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.17], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(t$95$4 + N[(x1 + N[(t$95$2 + N[(N[(t$95$3 * t$95$5), $MachinePrecision] + N[(t$95$0 * N[(t$95$6 + N[(t$95$1 * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := \left(x1 \cdot 2\right) \cdot 3\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := 3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_0}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right)\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -40:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_2 + \left(3 \cdot t\_3 + t\_0 \cdot \left(t\_6 + \left(t\_5 - 3\right) \cdot t\_1\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.17:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_4 + \left(x1 + \left(t\_2 + \left(t\_3 \cdot t\_5 + t\_0 \cdot \left(t\_6 + t\_1 \cdot 0\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5.49999999999999981e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5.49999999999999981e102 < x1 < -40Initial program 99.0%
Taylor expanded in x1 around inf 83.2%
Taylor expanded in x1 around inf 83.4%
if -40 < x1 < 0.170000000000000012Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 98.9%
if 0.170000000000000012 < x1 < 5.00000000000000018e153Initial program 99.1%
Taylor expanded in x1 around inf 84.2%
Taylor expanded in x1 around inf 84.2%
if 5.00000000000000018e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification96.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4 (* (* x1 x1) (- (* t_3 4.0) 6.0)))
(t_5 (* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0)))
(t_6 (* t_2 t_3)))
(if (<= x1 -1e+103)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -350.0)
(+ x1 (+ t_5 (+ x1 (+ t_1 (+ t_6 (* t_0 (+ t_4 -6.0)))))))
(if (<= x1 0.17)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5e+153)
(+
x1
(+
t_5
(+
x1
(+ t_1 (+ t_6 (* t_0 (+ t_4 (* (* (* x1 2.0) 3.0) 0.0))))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_6 = t_2 * t_3;
double tmp;
if (x1 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -350.0) {
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + -6.0))))));
} else if (x1 <= 0.17) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (((x1 * 2.0) * 3.0) * 0.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = (x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)
t_5 = 3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)
t_6 = t_2 * t_3
if (x1 <= (-1d+103)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-350.0d0)) then
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (-6.0d0)))))))
else if (x1 <= 0.17d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5d+153) then
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (((x1 * 2.0d0) * 3.0d0) * 0.0d0)))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.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 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0);
double t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0);
double t_6 = t_2 * t_3;
double tmp;
if (x1 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -350.0) {
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + -6.0))))));
} else if (x1 <= 0.17) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (((x1 * 2.0) * 3.0) * 0.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0) t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0) t_6 = t_2 * t_3 tmp = 0 if x1 <= -1e+103: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -350.0: tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + -6.0)))))) elif x1 <= 0.17: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5e+153: tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (((x1 * 2.0) * 3.0) * 0.0))))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) t_5 = Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) t_6 = Float64(t_2 * t_3) tmp = 0.0 if (x1 <= -1e+103) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -350.0) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_1 + Float64(t_6 + Float64(t_0 * Float64(t_4 + -6.0))))))); elseif (x1 <= 0.17) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(t_5 + Float64(x1 + Float64(t_1 + Float64(t_6 + Float64(t_0 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * 3.0) * 0.0)))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = (x1 * x1) * ((t_3 * 4.0) - 6.0); t_5 = 3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0); t_6 = t_2 * t_3; tmp = 0.0; if (x1 <= -1e+103) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -350.0) tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + -6.0)))))); elseif (x1 <= 0.17) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5e+153) tmp = x1 + (t_5 + (x1 + (t_1 + (t_6 + (t_0 * (t_4 + (((x1 * 2.0) * 3.0) * 0.0))))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * t$95$3), $MachinePrecision]}, If[LessEqual[x1, -1e+103], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -350.0], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$1 + N[(t$95$6 + N[(t$95$0 * N[(t$95$4 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.17], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(t$95$5 + N[(x1 + N[(t$95$1 + N[(t$95$6 + N[(t$95$0 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\\
t_5 := 3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0}\\
t_6 := t\_2 \cdot t\_3\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -350:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_1 + \left(t\_6 + t\_0 \cdot \left(t\_4 + -6\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 0.17:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(t\_5 + \left(x1 + \left(t\_1 + \left(t\_6 + t\_0 \cdot \left(t\_4 + \left(\left(x1 \cdot 2\right) \cdot 3\right) \cdot 0\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1e103Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1e103 < x1 < -350Initial program 99.0%
Taylor expanded in x1 around inf 94.7%
associate-*r/94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in x1 around inf 82.6%
if -350 < x1 < 0.170000000000000012Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 87.3%
Taylor expanded in x2 around 0 98.9%
if 0.170000000000000012 < x1 < 5.00000000000000018e153Initial program 99.1%
Taylor expanded in x1 around inf 84.2%
Taylor expanded in x1 around inf 84.2%
if 5.00000000000000018e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification96.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 (<= x1 -1e+103)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 5e+153)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.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 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= (-1d+103)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 5d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= -1e+103: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 5e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= -1e+103) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.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 <= -1e+103) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 5e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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[LessEqual[x1, -1e+103], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -1e103Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1e103 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if 5.00000000000000018e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.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
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_2)
(* t_0 (+ (* (* x1 x1) (- (* t_2 4.0) 6.0)) -6.0)))))))))
(if (<= x1 -5e+102)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -56.0)
t_3
(if (<= x1 12600.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5e+153)
t_3
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.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 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -56.0) {
tmp = t_3;
} else if (x1 <= 12600.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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_0
t_3 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + (-6.0d0)))))))
if (x1 <= (-5d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-56.0d0)) then
tmp = t_3
else if (x1 <= 12600.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5d+153) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.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 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -56.0) {
tmp = t_3;
} else if (x1 <= 12600.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + -6.0)))))) tmp = 0 if x1 <= -5e+102: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -56.0: tmp = t_3 elif x1 <= 12600.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5e+153: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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) t_3 = 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_1 * t_2) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + -6.0))))))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -56.0) tmp = t_3; elseif (x1 <= 12600.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5e+153) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.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; t_3 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_2) + (t_0 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + -6.0)))))); tmp = 0.0; if (x1 <= -5e+102) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -56.0) tmp = t_3; elseif (x1 <= 12600.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5e+153) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$2), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -56.0], t$95$3, If[LessEqual[x1, 12600.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_2 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -56:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 12600:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -5e102 < x1 < -56 or 12600 < x1 < 5.00000000000000018e153Initial program 99.2%
Taylor expanded in x1 around inf 97.7%
associate-*r/97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in x1 around inf 85.1%
if -56 < x1 < 12600Initial program 99.4%
Simplified99.7%
Taylor expanded in x1 around 0 86.8%
Taylor expanded in x2 around 0 98.3%
if 5.00000000000000018e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification96.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 (<= x1 -3e+102)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 5e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_1)
(*
t_0
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.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 <= -3e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= (-3d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_1) + (t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.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 <= -3e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= -3e+102: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 5e+153: tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 <= -3e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 5e+153) 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(3.0 * t_1) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.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 <= -3e+102) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_1) + (t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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, -3e+102], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], 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[(3.0 * t$95$1), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
\mathbf{if}\;x1 \leq -3 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;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(3 \cdot t\_1 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -2.9999999999999998e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 70.3%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.9999999999999998e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around inf 96.7%
if 5.00000000000000018e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification97.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 -3.8e+54)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -2.4e-107)
t_0
(if (<= x1 6.2e-93)
(- (* x2 -6.0) x1)
(if (<= x1 4.5e+153)
t_0
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -3.8e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.4e-107) {
tmp = t_0;
} else if (x1 <= 6.2e-93) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 (x1 <= (-3.8d+54)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-2.4d-107)) then
tmp = t_0
else if (x1 <= 6.2d-93) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.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 (x1 <= -3.8e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.4e-107) {
tmp = t_0;
} else if (x1 <= 6.2e-93) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x1 <= -3.8e+54: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -2.4e-107: tmp = t_0 elif x1 <= 6.2e-93: tmp = (x2 * -6.0) - x1 elif x1 <= 4.5e+153: tmp = t_0 else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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 (x1 <= -3.8e+54) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -2.4e-107) tmp = t_0; elseif (x1 <= 6.2e-93) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.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 (x1 <= -3.8e+54) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -2.4e-107) tmp = t_0; elseif (x1 <= 6.2e-93) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.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[x1, -3.8e+54], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.4e-107], t$95$0, If[LessEqual[x1, 6.2e-93], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $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}\;x1 \leq -3.8 \cdot 10^{+54}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -2.4 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 6.2 \cdot 10^{-93}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -3.8000000000000002e54Initial program 15.7%
Simplified15.7%
Taylor expanded in x1 around 0 60.2%
Taylor expanded in x2 around 0 85.2%
*-commutative85.2%
Simplified85.2%
if -3.8000000000000002e54 < x1 < -2.39999999999999994e-107 or 6.19999999999999999e-93 < x1 < 4.5000000000000001e153Initial program 99.3%
Simplified99.5%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around inf 52.6%
if -2.39999999999999994e-107 < x1 < 6.19999999999999999e-93Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x2 around 0 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x2 around 0 87.5%
mul-1-neg87.5%
Simplified87.5%
if 4.5000000000000001e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification76.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(t_1 (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0)))))
(if (<= x1 -3.8e+54)
t_1
(if (<= x1 -8.2e-107)
t_0
(if (<= x1 5.8e-93)
(- (* x2 -6.0) x1)
(if (<= x1 4.5e+153) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double t_1 = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
double tmp;
if (x1 <= -3.8e+54) {
tmp = t_1;
} else if (x1 <= -8.2e-107) {
tmp = t_0;
} else if (x1 <= 5.8e-93) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = 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) :: tmp
t_0 = x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
t_1 = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
if (x1 <= (-3.8d+54)) then
tmp = t_1
else if (x1 <= (-8.2d-107)) then
tmp = t_0
else if (x1 <= 5.8d-93) then
tmp = (x2 * (-6.0d0)) - x1
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = t_1
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 t_1 = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
double tmp;
if (x1 <= -3.8e+54) {
tmp = t_1;
} else if (x1 <= -8.2e-107) {
tmp = t_0;
} else if (x1 <= 5.8e-93) {
tmp = (x2 * -6.0) - x1;
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) t_1 = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) tmp = 0 if x1 <= -3.8e+54: tmp = t_1 elif x1 <= -8.2e-107: tmp = t_0 elif x1 <= 5.8e-93: tmp = (x2 * -6.0) - x1 elif x1 <= 4.5e+153: tmp = t_0 else: tmp = t_1 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))))) t_1 = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))) tmp = 0.0 if (x1 <= -3.8e+54) tmp = t_1; elseif (x1 <= -8.2e-107) tmp = t_0; elseif (x1 <= 5.8e-93) tmp = Float64(Float64(x2 * -6.0) - x1); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); t_1 = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); tmp = 0.0; if (x1 <= -3.8e+54) tmp = t_1; elseif (x1 <= -8.2e-107) tmp = t_0; elseif (x1 <= 5.8e-93) tmp = (x2 * -6.0) - x1; elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.8e+54], t$95$1, If[LessEqual[x1, -8.2e-107], t$95$0, If[LessEqual[x1, 5.8e-93], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, t$95$1]]]]]]
\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)\\
t_1 := x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -8.2 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 5.8 \cdot 10^{-93}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -3.8000000000000002e54 or 4.5000000000000001e153 < x1 Initial program 10.2%
Simplified10.2%
Taylor expanded in x1 around inf 10.2%
Taylor expanded in x1 around 0 57.1%
Taylor expanded in x2 around 0 83.1%
if -3.8000000000000002e54 < x1 < -8.1999999999999998e-107 or 5.7999999999999997e-93 < x1 < 4.5000000000000001e153Initial program 99.3%
Simplified99.5%
Taylor expanded in x1 around 0 59.4%
Taylor expanded in x1 around inf 52.6%
if -8.1999999999999998e-107 < x1 < 5.7999999999999997e-93Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 85.7%
Taylor expanded in x2 around 0 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x2 around 0 87.5%
mul-1-neg87.5%
Simplified87.5%
Final simplification73.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.8e+54)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 4e+153)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 4e+153) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.8d+54)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 4d+153) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 4e+153) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.8e+54: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 4e+153: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+54) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 4e+153) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.8e+54) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 4e+153) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+54], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+153], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+54}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -3.8000000000000002e54Initial program 15.7%
Simplified15.7%
Taylor expanded in x1 around 0 60.2%
Taylor expanded in x2 around 0 85.2%
*-commutative85.2%
Simplified85.2%
if -3.8000000000000002e54 < x1 < 4e153Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x2 around 0 81.4%
if 4e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification84.5%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.95e+54)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 4.5e+153)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))))
(+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.95e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.95d+54)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 4.5d+153) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.95e+54) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
} else {
tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.95e+54: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 4.5e+153: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))) else: tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.95e+54) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 4.5e+153) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.95e+54) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 4.5e+153) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))); else tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.95e+54], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.95 \cdot 10^{+54}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -2.9499999999999999e54Initial program 15.7%
Simplified15.7%
Taylor expanded in x1 around 0 60.2%
Taylor expanded in x2 around 0 85.2%
*-commutative85.2%
Simplified85.2%
if -2.9499999999999999e54 < x1 < 4.5000000000000001e153Initial program 99.4%
Simplified99.6%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x2 around 0 72.4%
if 4.5000000000000001e153 < x1 Initial program 2.9%
Simplified2.9%
Taylor expanded in x1 around inf 2.9%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x2 around 0 100.0%
Final simplification78.3%
(FPCore (x1 x2) :precision binary64 (if (<= x1 9.5e+26) (- (* x2 -6.0) x1) (* x2 (- (* x1 -12.0) 6.0))))
double code(double x1, double x2) {
double tmp;
if (x1 <= 9.5e+26) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x2 * ((x1 * -12.0) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= 9.5d+26) then
tmp = (x2 * (-6.0d0)) - x1
else
tmp = x2 * ((x1 * (-12.0d0)) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 9.5e+26) {
tmp = (x2 * -6.0) - x1;
} else {
tmp = x2 * ((x1 * -12.0) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 9.5e+26: tmp = (x2 * -6.0) - x1 else: tmp = x2 * ((x1 * -12.0) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 9.5e+26) tmp = Float64(Float64(x2 * -6.0) - x1); else tmp = Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 9.5e+26) tmp = (x2 * -6.0) - x1; else tmp = x2 * ((x1 * -12.0) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 9.5e+26], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision], N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 9.5 \cdot 10^{+26}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(x1 \cdot -12 - 6\right)\\
\end{array}
\end{array}
if x1 < 9.50000000000000054e26Initial program 80.5%
Simplified80.7%
Taylor expanded in x1 around 0 63.4%
Taylor expanded in x2 around 0 52.3%
*-commutative52.3%
Simplified52.3%
Taylor expanded in x2 around 0 50.8%
mul-1-neg50.8%
Simplified50.8%
if 9.50000000000000054e26 < x1 Initial program 45.6%
Simplified45.7%
Taylor expanded in x1 around 0 35.1%
Taylor expanded in x2 around 0 18.4%
*-commutative18.4%
Simplified18.4%
Taylor expanded in x2 around inf 19.3%
Final simplification43.3%
(FPCore (x1 x2) :precision binary64 (+ (* x2 -6.0) (* x1 (+ (* x1 9.0) -1.0))))
double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) + (x1 * ((x1 * 9.0d0) + (-1.0d0)))
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0));
}
def code(x1, x2): return (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0))
function code(x1, x2) return Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0))) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) + (x1 * ((x1 * 9.0) + -1.0)); end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 + x1 \cdot \left(x1 \cdot 9 + -1\right)
\end{array}
Initial program 72.2%
Simplified72.4%
Taylor expanded in x1 around inf 71.6%
Taylor expanded in x1 around 0 67.4%
Taylor expanded in x2 around 0 63.9%
Final simplification63.9%
(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%
Simplified72.4%
Taylor expanded in x1 around 0 56.7%
Taylor expanded in x2 around 0 44.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in x2 around 0 38.9%
mul-1-neg38.9%
Simplified38.9%
Final simplification38.9%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 72.2%
Simplified72.4%
Taylor expanded in x1 around 0 28.1%
*-commutative28.1%
Simplified28.1%
herbie shell --seed 2024133
(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))))))