
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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.5%
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%
Taylor expanded in x1 around inf 13.8%
Taylor expanded in x1 around inf 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (+ x1 (* 6.0 (pow x1 4.0))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * pow(x1, 4.0));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (6.0 * math.pow(x1, 4.0)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (6.0 * (x1 ^ 4.0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #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.5%
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%
Taylor expanded in x1 around inf 13.8%
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)))
(if (<= x1 -5.5e+66)
(+ x1 (* 6.0 (pow x1 4.0)))
(if (<= x1 4.5e+153)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))))
(* 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 <= -5.5e+66) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = 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 <= (-5.5d+66)) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))))
else
tmp = 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 <= -5.5e+66) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))));
} else {
tmp = 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 <= -5.5e+66: tmp = x1 + (6.0 * math.pow(x1, 4.0)) elif x1 <= 4.5e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))) else: tmp = 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 <= -5.5e+66) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))))); else tmp = 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 <= -5.5e+66) tmp = x1 + (6.0 * (x1 ^ 4.0)); elseif (x1 <= 4.5e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1))))))))); else tmp = 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, -5.5e+66], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.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}\\
\mathbf{if}\;x1 \leq -5.5 \cdot 10^{+66}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(t\_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\end{array}
\end{array}
if x1 < -5.5e66Initial program 18.2%
Taylor expanded in x1 around inf 41.0%
Taylor expanded in x1 around inf 98.2%
if -5.5e66 < x1 < 4.5000000000000001e153Initial program 99.5%
Taylor expanded in x1 around 0 97.6%
+-commutative97.6%
mul-1-neg97.6%
unsub-neg97.6%
Simplified97.6%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.2%
(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 9.0) -1.0))))
(if (<= x1 -2.9e+31)
(+ x1 (* 6.0 (pow x1 4.0)))
(if (<= x1 0.0005)
(+ t_3 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(if (<= x1 5e+153)
(+
x1
(+
(+
x1
(+
(+
(*
t_0
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_1 t_2))
(* x1 (* x1 x1))))
9.0))
t_3)))))
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 * 9.0) + -1.0);
double tmp;
if (x1 <= -2.9e+31) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else if (x1 <= 0.0005) {
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + 9.0);
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 * ((x1 * 9.0d0) + (-1.0d0))
if (x1 <= (-2.9d+31)) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= 0.0005d0) then
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else if (x1 <= 5d+153) then
tmp = x1 + ((x1 + (((t_0 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + 9.0d0)
else
tmp = t_3
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 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -2.9e+31) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= 0.0005) {
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + 9.0);
} else {
tmp = t_3;
}
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 * 9.0) + -1.0) tmp = 0 if x1 <= -2.9e+31: tmp = x1 + (6.0 * math.pow(x1, 4.0)) elif x1 <= 0.0005: tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) elif x1 <= 5e+153: tmp = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + 9.0) else: tmp = t_3 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 * 9.0) + -1.0)) tmp = 0.0 if (x1 <= -2.9e+31) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= 0.0005) tmp = Float64(t_3 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_0 * 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_1 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + 9.0)); else tmp = t_3; 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 * 9.0) + -1.0); tmp = 0.0; if (x1 <= -2.9e+31) tmp = x1 + (6.0 * (x1 ^ 4.0)); elseif (x1 <= 0.0005) tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); elseif (x1 <= 5e+153) tmp = x1 + ((x1 + (((t_0 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_1 * t_2)) + (x1 * (x1 * x1)))) + 9.0); else tmp = t_3; 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 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.9e+31], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.0005], N[(t$95$3 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(x1 + N[(N[(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] * 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] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\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 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{if}\;x1 \leq -2.9 \cdot 10^{+31}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 0.0005:\\
\;\;\;\;t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(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 \left(t\_2 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x1 < -2.9e31Initial program 22.9%
Taylor expanded in x1 around inf 44.4%
Taylor expanded in x1 around inf 98.2%
if -2.9e31 < x1 < 5.0000000000000001e-4Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x2 around 0 86.0%
Taylor expanded in x2 around 0 97.5%
Taylor expanded in x2 around inf 97.5%
*-commutative97.5%
*-commutative97.5%
associate-*r*97.5%
Simplified97.5%
if 5.0000000000000001e-4 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 9.0) -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
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_3)
(*
t_2
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* (- t_3 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))
9.0))))
(if (<= x1 -2.1e+102)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -2.1)
t_4
(if (<= x1 0.0005)
(+ t_0 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(if (<= x1 4.5e+153) t_4 t_0))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -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 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
double tmp;
if (x1 <= -2.1e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.1) {
tmp = t_4;
} else if (x1 <= 0.0005) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = t_4;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) + (-1.0d0))
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))) + 9.0d0)
if (x1 <= (-2.1d+102)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-2.1d0)) then
tmp = t_4
else if (x1 <= 0.0005d0) then
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else if (x1 <= 4.5d+153) then
tmp = t_4
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -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 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
double tmp;
if (x1 <= -2.1e+102) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.1) {
tmp = t_4;
} else if (x1 <= 0.0005) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = t_4;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) + -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 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0) tmp = 0 if x1 <= -2.1e+102: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -2.1: tmp = t_4 elif x1 <= 0.0005: tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) elif x1 <= 4.5e+153: tmp = t_4 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) + -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(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))) + 9.0)) tmp = 0.0 if (x1 <= -2.1e+102) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -2.1) tmp = t_4; elseif (x1 <= 0.0005) tmp = Float64(t_0 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); elseif (x1 <= 4.5e+153) tmp = t_4; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) + -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 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + ((t_3 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0); tmp = 0.0; if (x1 <= -2.1e+102) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -2.1) tmp = t_4; elseif (x1 <= 0.0005) tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); elseif (x1 <= 4.5e+153) tmp = t_4; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -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[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2.1e+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, -2.1], t$95$4, If[LessEqual[x1, 0.0005], N[(t$95$0 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$4, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 + -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 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right) + 9\right)\\
\mathbf{if}\;x1 \leq -2.1 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -2.1:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 0.0005:\\
\;\;\;\;t\_0 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -2.10000000000000001e102Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 82.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -2.10000000000000001e102 < x1 < -2.10000000000000009 or 5.0000000000000001e-4 < x1 < 4.5000000000000001e153Initial program 99.3%
Taylor expanded in x1 around 0 92.9%
+-commutative92.9%
mul-1-neg92.9%
unsub-neg92.9%
Simplified92.9%
Taylor expanded in x1 around inf 92.9%
if -2.10000000000000009 < x1 < 5.0000000000000001e-4Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 87.1%
Taylor expanded in x2 around 0 98.9%
Taylor expanded in x2 around inf 98.9%
*-commutative98.9%
*-commutative98.9%
associate-*r*98.9%
Simplified98.9%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification98.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3 (* x1 (+ (* x1 9.0) -1.0))))
(if (<= x1 -6.5e+31)
(+ x1 (* 6.0 (pow x1 4.0)))
(if (<= x1 0.0005)
(+ t_3 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(if (<= x1 4.5e+153)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_2)
(*
t_1
(+
(* (* x1 x1) (- (* t_2 4.0) 6.0))
(* (- t_2 3.0) (* (* x1 2.0) (- (* 2.0 x2) x1))))))))
9.0))
t_3)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -6.5e+31) {
tmp = x1 + (6.0 * pow(x1, 4.0));
} else if (x1 <= 0.0005) {
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
t_3 = x1 * ((x1 * 9.0d0) + (-1.0d0))
if (x1 <= (-6.5d+31)) then
tmp = x1 + (6.0d0 * (x1 ** 4.0d0))
else if (x1 <= 0.0005d0) then
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)) + ((t_2 - 3.0d0) * ((x1 * 2.0d0) * ((2.0d0 * x2) - x1)))))))) + 9.0d0)
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -6.5e+31) {
tmp = x1 + (6.0 * Math.pow(x1, 4.0));
} else if (x1 <= 0.0005) {
tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0);
} else {
tmp = t_3;
}
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 * 9.0) + -1.0) tmp = 0 if x1 <= -6.5e+31: tmp = x1 + (6.0 * math.pow(x1, 4.0)) elif x1 <= 0.0005: tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) elif x1 <= 4.5e+153: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0) else: tmp = t_3 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) tmp = 0.0 if (x1 <= -6.5e+31) tmp = Float64(x1 + Float64(6.0 * (x1 ^ 4.0))); elseif (x1 <= 0.0005) tmp = Float64(t_3 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_2) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)) + Float64(Float64(t_2 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(Float64(2.0 * x2) - x1)))))))) + 9.0)); else tmp = t_3; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 * ((x1 * 9.0) + -1.0); tmp = 0.0; if (x1 <= -6.5e+31) tmp = x1 + (6.0 * (x1 ^ 4.0)); elseif (x1 <= 0.0005) tmp = t_3 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); elseif (x1 <= 4.5e+153) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_0 * t_2) + (t_1 * (((x1 * x1) * ((t_2 * 4.0) - 6.0)) + ((t_2 - 3.0) * ((x1 * 2.0) * ((2.0 * x2) - x1)))))))) + 9.0); else tmp = t_3; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(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 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -6.5e+31], N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.0005], N[(t$95$3 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$2), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(2.0 * x2), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\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 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{if}\;x1 \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;x1 + 6 \cdot {x1}^{4}\\
\mathbf{elif}\;x1 \leq 0.0005:\\
\;\;\;\;t\_3 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_2 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right) + \left(t\_2 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(2 \cdot x2 - x1\right)\right)\right)\right)\right)\right) + 9\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x1 < -6.5000000000000004e31Initial program 22.9%
Taylor expanded in x1 around inf 44.4%
Taylor expanded in x1 around inf 98.2%
if -6.5000000000000004e31 < x1 < 5.0000000000000001e-4Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x2 around 0 86.0%
Taylor expanded in x2 around 0 97.5%
Taylor expanded in x2 around inf 97.5%
*-commutative97.5%
*-commutative97.5%
associate-*r*97.5%
Simplified97.5%
if 5.0000000000000001e-4 < x1 < 4.5000000000000001e153Initial program 99.4%
Taylor expanded in x1 around 0 93.8%
+-commutative93.8%
mul-1-neg93.8%
unsub-neg93.8%
Simplified93.8%
Taylor expanded in x1 around inf 93.8%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification97.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (+ (* x1 9.0) -1.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(* t_0 (+ (* (* x1 x1) (- (* t_3 4.0) 6.0)) -6.0)))))))))
(if (<= x1 -1e+103)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -2.8e+31)
t_4
(if (<= x1 250000.0)
(+ t_1 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(if (<= x1 5e+153) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * ((x1 * 9.0) + -1.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.8e+31) {
tmp = t_4;
} else if (x1 <= 250000.0) {
tmp = t_1 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 5e+153) {
tmp = t_4;
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * ((x1 * 9.0d0) + (-1.0d0))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (-6.0d0)))))))
if (x1 <= (-1d+103)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-2.8d+31)) then
tmp = t_4
else if (x1 <= 250000.0d0) then
tmp = t_1 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else if (x1 <= 5d+153) then
tmp = t_4
else
tmp = 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 * 9.0) + -1.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -1e+103) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -2.8e+31) {
tmp = t_4;
} else if (x1 <= 250000.0) {
tmp = t_1 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * ((x1 * 9.0) + -1.0) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + -6.0)))))) tmp = 0 if x1 <= -1e+103: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -2.8e+31: tmp = t_4 elif x1 <= 250000.0: tmp = t_1 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) elif x1 <= 5e+153: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + -6.0))))))) 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 <= -2.8e+31) tmp = t_4; elseif (x1 <= 250000.0) tmp = Float64(t_1 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * ((x1 * 9.0) + -1.0); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + -6.0)))))); tmp = 0.0; if (x1 <= -1e+103) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -2.8e+31) tmp = t_4; elseif (x1 <= 250000.0) tmp = t_1 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); elseif (x1 <= 5e+153) tmp = t_4; else tmp = 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[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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, -2.8e+31], t$95$4, If[LessEqual[x1, 250000.0], N[(t$95$1 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 9 + -1\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\
\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 -2.8 \cdot 10^{+31}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 250000:\\
\;\;\;\;t\_1 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1e103Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 82.5%
Taylor expanded in x2 around 0 100.0%
*-commutative100.0%
Simplified100.0%
if -1e103 < x1 < -2.80000000000000017e31 or 2.5e5 < x1 < 5.00000000000000018e153Initial program 99.3%
Taylor expanded in x1 around -inf 99.3%
Taylor expanded in x1 around inf 96.7%
if -2.80000000000000017e31 < x1 < 2.5e5Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 85.6%
Taylor expanded in x2 around 0 85.6%
Taylor expanded in x2 around 0 96.9%
Taylor expanded in x2 around inf 96.9%
*-commutative96.9%
*-commutative96.9%
associate-*r*96.9%
Simplified96.9%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification97.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 9.0) -1.0))))
(if (<= x1 -4.5e+36)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 7.6e+100)
(+ t_0 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(if (<= x1 4.5e+153)
(+
x1
(+
(* x2 -6.0)
(* x1 (- (* x1 (+ (* x1 3.0) (* 3.0 (- 3.0 (* x2 -2.0))))) 2.0))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 7.6e+100) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) + (-1.0d0))
if (x1 <= (-4.5d+36)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 7.6d+100) then
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((x1 * ((x1 * 3.0d0) + (3.0d0 * (3.0d0 - (x2 * (-2.0d0)))))) - 2.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 7.6e+100) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) + -1.0) tmp = 0 if x1 <= -4.5e+36: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 7.6e+100: tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) elif x1 <= 4.5e+153: tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) tmp = 0.0 if (x1 <= -4.5e+36) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 7.6e+100) tmp = Float64(t_0 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(Float64(x1 * 3.0) + Float64(3.0 * Float64(3.0 - Float64(x2 * -2.0))))) - 2.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) + -1.0); tmp = 0.0; if (x1 <= -4.5e+36) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 7.6e+100) tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); elseif (x1 <= 4.5e+153) tmp = x1 + ((x2 * -6.0) + (x1 * ((x1 * ((x1 * 3.0) + (3.0 * (3.0 - (x2 * -2.0))))) - 2.0))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+36], 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, 7.6e+100], N[(t$95$0 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + N[(3.0 * N[(3.0 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+100}:\\
\;\;\;\;t\_0 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(x1 \cdot 3 + 3 \cdot \left(3 - x2 \cdot -2\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -4.49999999999999997e36Initial program 22.9%
Simplified22.8%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x2 around 0 78.6%
*-commutative78.6%
Simplified78.6%
if -4.49999999999999997e36 < x1 < 7.59999999999999927e100Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 80.8%
Taylor expanded in x2 around 0 80.8%
Taylor expanded in x2 around 0 90.9%
Taylor expanded in x2 around inf 90.9%
*-commutative90.9%
*-commutative90.9%
associate-*r*90.9%
Simplified90.9%
if 7.59999999999999927e100 < x1 < 4.5000000000000001e153Initial program 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around 0 100.0%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Simplified0.0%
Taylor expanded in x1 around 0 74.5%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Taylor expanded in x2 around 0 100.0%
Final simplification90.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ (* x1 9.0) -1.0))))
(if (<= x1 -4.5e+36)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 3.1e+75)
(+ t_0 (* x2 (- (* x2 (* x1 8.0)) 6.0)))
(* x2 (- (/ t_0 x2) 6.0))))))
double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 3.1e+75) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else {
tmp = x2 * ((t_0 / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: tmp
t_0 = x1 * ((x1 * 9.0d0) + (-1.0d0))
if (x1 <= (-4.5d+36)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 3.1d+75) then
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0d0)) - 6.0d0))
else
tmp = x2 * ((t_0 / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * ((x1 * 9.0) + -1.0);
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 3.1e+75) {
tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0));
} else {
tmp = x2 * ((t_0 / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): t_0 = x1 * ((x1 * 9.0) + -1.0) tmp = 0 if x1 <= -4.5e+36: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 3.1e+75: tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)) else: tmp = x2 * ((t_0 / x2) - 6.0) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) tmp = 0.0 if (x1 <= -4.5e+36) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 3.1e+75) tmp = Float64(t_0 + Float64(x2 * Float64(Float64(x2 * Float64(x1 * 8.0)) - 6.0))); else tmp = Float64(x2 * Float64(Float64(t_0 / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * ((x1 * 9.0) + -1.0); tmp = 0.0; if (x1 <= -4.5e+36) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 3.1e+75) tmp = t_0 + (x2 * ((x2 * (x1 * 8.0)) - 6.0)); else tmp = x2 * ((t_0 / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.5e+36], 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, 3.1e+75], N[(t$95$0 + N[(x2 * N[(N[(x2 * N[(x1 * 8.0), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(t$95$0 / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{+75}:\\
\;\;\;\;t\_0 + x2 \cdot \left(x2 \cdot \left(x1 \cdot 8\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{t\_0}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < -4.49999999999999997e36Initial program 22.9%
Simplified22.8%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x2 around 0 78.6%
*-commutative78.6%
Simplified78.6%
if -4.49999999999999997e36 < x1 < 3.1000000000000001e75Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 81.7%
Taylor expanded in x2 around 0 81.7%
Taylor expanded in x2 around 0 92.0%
Taylor expanded in x2 around inf 92.0%
*-commutative92.0%
*-commutative92.0%
associate-*r*92.0%
Simplified92.0%
if 3.1000000000000001e75 < x1 Initial program 21.7%
Simplified21.7%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in x2 around inf 89.1%
Final simplification88.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.25e+35)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 1.85e+81)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(* x2 (- (/ (* x1 (+ (* x1 9.0) -1.0)) x2) 6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.25e+35) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 1.85e+81) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.25d+35)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 1.85d+81) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = x2 * (((x1 * ((x1 * 9.0d0) + (-1.0d0))) / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.25e+35) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 1.85e+81) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.25e+35: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 1.85e+81: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.25e+35) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 1.85e+81) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.25e+35) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 1.85e+81) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.25e+35], 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, 1.85e+81], 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[(x2 * N[(N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.25 \cdot 10^{+35}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 1.85 \cdot 10^{+81}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot 9 + -1\right)}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < -2.2499999999999998e35Initial program 22.9%
Simplified22.8%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x2 around 0 78.6%
*-commutative78.6%
Simplified78.6%
if -2.2499999999999998e35 < x1 < 1.85e81Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 81.7%
Taylor expanded in x2 around 0 81.7%
Taylor expanded in x2 around 0 92.0%
Taylor expanded in x1 around 0 91.6%
neg-mul-191.6%
Simplified91.6%
if 1.85e81 < x1 Initial program 21.7%
Simplified21.7%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in x2 around inf 89.1%
Final simplification88.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4.5e+36)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 2.25e+77)
(+ (* x2 -6.0) (* x1 (+ (* x2 (- (* x2 8.0) 12.0)) -1.0)))
(* x2 (- (/ (* x1 (+ (* x1 9.0) -1.0)) x2) 6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 2.25e+77) {
tmp = (x2 * -6.0) + (x1 * ((x2 * ((x2 * 8.0) - 12.0)) + -1.0));
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.5d+36)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= 2.25d+77) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x2 * ((x2 * 8.0d0) - 12.0d0)) + (-1.0d0)))
else
tmp = x2 * (((x1 * ((x1 * 9.0d0) + (-1.0d0))) / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.5e+36) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= 2.25e+77) {
tmp = (x2 * -6.0) + (x1 * ((x2 * ((x2 * 8.0) - 12.0)) + -1.0));
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.5e+36: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= 2.25e+77: tmp = (x2 * -6.0) + (x1 * ((x2 * ((x2 * 8.0) - 12.0)) + -1.0)) else: tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.5e+36) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= 2.25e+77) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0)) + -1.0))); else tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.5e+36) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= 2.25e+77) tmp = (x2 * -6.0) + (x1 * ((x2 * ((x2 * 8.0) - 12.0)) + -1.0)); else tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.5e+36], 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.25e+77], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.5 \cdot 10^{+36}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq 2.25 \cdot 10^{+77}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x2 \cdot \left(x2 \cdot 8 - 12\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot 9 + -1\right)}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < -4.49999999999999997e36Initial program 22.9%
Simplified22.8%
Taylor expanded in x1 around 0 65.1%
Taylor expanded in x2 around 0 78.6%
*-commutative78.6%
Simplified78.6%
if -4.49999999999999997e36 < x1 < 2.25000000000000012e77Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 81.7%
Taylor expanded in x2 around 0 81.7%
Taylor expanded in x2 around 0 92.0%
Taylor expanded in x1 around 0 81.3%
if 2.25000000000000012e77 < x1 Initial program 21.7%
Simplified21.7%
Taylor expanded in x1 around 0 62.9%
Taylor expanded in x2 around 0 79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in x2 around inf 89.1%
Final simplification82.6%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -5.8e-17)
(+ (* x2 -6.0) (* x1 (+ (* x1 (+ 9.0 (* x1 -19.0))) -1.0)))
(if (<= x1 -6e-290)
(* x1 (+ (* -6.0 (/ x2 x1)) -1.0))
(* x2 (- (/ (* x1 (+ (* x1 9.0) -1.0)) x2) 6.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -5.8e-17) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -6e-290) {
tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0);
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-5.8d-17)) then
tmp = (x2 * (-6.0d0)) + (x1 * ((x1 * (9.0d0 + (x1 * (-19.0d0)))) + (-1.0d0)))
else if (x1 <= (-6d-290)) then
tmp = x1 * (((-6.0d0) * (x2 / x1)) + (-1.0d0))
else
tmp = x2 * (((x1 * ((x1 * 9.0d0) + (-1.0d0))) / x2) - 6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -5.8e-17) {
tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0));
} else if (x1 <= -6e-290) {
tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0);
} else {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -5.8e-17: tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)) elif x1 <= -6e-290: tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0) else: tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -5.8e-17) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))) + -1.0))); elseif (x1 <= -6e-290) tmp = Float64(x1 * Float64(Float64(-6.0 * Float64(x2 / x1)) + -1.0)); else tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) / x2) - 6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -5.8e-17) tmp = (x2 * -6.0) + (x1 * ((x1 * (9.0 + (x1 * -19.0))) + -1.0)); elseif (x1 <= -6e-290) tmp = x1 * ((-6.0 * (x2 / x1)) + -1.0); else tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -5.8e-17], 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, -6e-290], N[(x1 * N[(N[(-6.0 * N[(x2 / x1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{-17}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(x1 \cdot \left(9 + x1 \cdot -19\right) + -1\right)\\
\mathbf{elif}\;x1 \leq -6 \cdot 10^{-290}:\\
\;\;\;\;x1 \cdot \left(-6 \cdot \frac{x2}{x1} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot 9 + -1\right)}{x2} - 6\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000006e-17Initial program 33.1%
Simplified33.1%
Taylor expanded in x1 around 0 58.4%
Taylor expanded in x2 around 0 70.5%
*-commutative70.5%
Simplified70.5%
if -5.8000000000000006e-17 < x1 < -5.99999999999999985e-290Initial program 99.5%
Simplified99.8%
Taylor expanded in x1 around 0 86.0%
Taylor expanded in x2 around 0 62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in x1 around 0 62.5%
*-commutative62.5%
mul-1-neg62.5%
unsub-neg62.5%
Simplified62.5%
Taylor expanded in x1 around inf 70.6%
if -5.99999999999999985e-290 < x1 Initial program 65.1%
Simplified65.2%
Taylor expanded in x1 around 0 72.6%
Taylor expanded in x2 around 0 69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in x2 around inf 73.2%
Final simplification72.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -9.2e+129) (not (<= x1 250000.0))) (* x1 (+ (* x1 9.0) -1.0)) (* x2 (- (- 6.0) (/ x1 x2)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.2e+129) || !(x1 <= 250000.0)) {
tmp = x1 * ((x1 * 9.0) + -1.0);
} else {
tmp = x2 * (-6.0 - (x1 / x2));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-9.2d+129)) .or. (.not. (x1 <= 250000.0d0))) then
tmp = x1 * ((x1 * 9.0d0) + (-1.0d0))
else
tmp = x2 * (-6.0d0 - (x1 / x2))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -9.2e+129) || !(x1 <= 250000.0)) {
tmp = x1 * ((x1 * 9.0) + -1.0);
} else {
tmp = x2 * (-6.0 - (x1 / x2));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -9.2e+129) or not (x1 <= 250000.0): tmp = x1 * ((x1 * 9.0) + -1.0) else: tmp = x2 * (-6.0 - (x1 / x2)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -9.2e+129) || !(x1 <= 250000.0)) tmp = Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)); else tmp = Float64(x2 * Float64(Float64(-6.0) - Float64(x1 / x2))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -9.2e+129) || ~((x1 <= 250000.0))) tmp = x1 * ((x1 * 9.0) + -1.0); else tmp = x2 * (-6.0 - (x1 / x2)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -9.2e+129], N[Not[LessEqual[x1, 250000.0]], $MachinePrecision]], N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x2 * N[((-6.0) - N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -9.2 \cdot 10^{+129} \lor \neg \left(x1 \leq 250000\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(-6\right) - \frac{x1}{x2}\right)\\
\end{array}
\end{array}
if x1 < -9.19999999999999961e129 or 2.5e5 < x1 Initial program 24.6%
Simplified24.6%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 71.1%
Taylor expanded in x2 around 0 70.1%
Taylor expanded in x2 around 0 73.3%
if -9.19999999999999961e129 < x1 < 2.5e5Initial program 94.2%
Simplified94.4%
Taylor expanded in x1 around 0 74.7%
Taylor expanded in x2 around 0 56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in x1 around 0 56.1%
*-commutative56.1%
mul-1-neg56.1%
unsub-neg56.1%
Simplified56.1%
Taylor expanded in x2 around -inf 58.0%
mul-1-neg58.0%
*-commutative58.0%
distribute-rgt-neg-in58.0%
Simplified58.0%
Final simplification64.3%
(FPCore (x1 x2) :precision binary64 (if (<= x2 1.22e-14) (* x2 (- (/ (* x1 (+ (* x1 9.0) -1.0)) x2) 6.0)) (+ (* x2 -6.0) (* x1 (+ (* (* x1 x2) 12.0) -1.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= 1.22e-14) {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
} else {
tmp = (x2 * -6.0) + (x1 * (((x1 * x2) * 12.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 (x2 <= 1.22d-14) then
tmp = x2 * (((x1 * ((x1 * 9.0d0) + (-1.0d0))) / x2) - 6.0d0)
else
tmp = (x2 * (-6.0d0)) + (x1 * (((x1 * x2) * 12.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= 1.22e-14) {
tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
} else {
tmp = (x2 * -6.0) + (x1 * (((x1 * x2) * 12.0) + -1.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= 1.22e-14: tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0) else: tmp = (x2 * -6.0) + (x1 * (((x1 * x2) * 12.0) + -1.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= 1.22e-14) tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) / x2) - 6.0)); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(Float64(x1 * x2) * 12.0) + -1.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= 1.22e-14) tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0); else tmp = (x2 * -6.0) + (x1 * (((x1 * x2) * 12.0) + -1.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, 1.22e-14], N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(N[(x1 * x2), $MachinePrecision] * 12.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq 1.22 \cdot 10^{-14}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot 9 + -1\right)}{x2} - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(\left(x1 \cdot x2\right) \cdot 12 + -1\right)\\
\end{array}
\end{array}
if x2 < 1.21999999999999994e-14Initial program 63.8%
Simplified63.9%
Taylor expanded in x1 around 0 65.5%
Taylor expanded in x2 around 0 68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x2 around inf 74.3%
if 1.21999999999999994e-14 < x2 Initial program 71.1%
Simplified71.1%
Taylor expanded in x1 around 0 78.3%
Taylor expanded in x2 around inf 78.3%
Taylor expanded in x1 around inf 57.6%
Taylor expanded in x2 around inf 57.6%
Final simplification70.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.22e-15) (not (<= x1 250000.0))) (* x1 (+ (* x1 9.0) -1.0)) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.22e-15) || !(x1 <= 250000.0)) {
tmp = x1 * ((x1 * 9.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.22d-15)) .or. (.not. (x1 <= 250000.0d0))) then
tmp = x1 * ((x1 * 9.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.22e-15) || !(x1 <= 250000.0)) {
tmp = x1 * ((x1 * 9.0) + -1.0);
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.22e-15) or not (x1 <= 250000.0): tmp = x1 * ((x1 * 9.0) + -1.0) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.22e-15) || !(x1 <= 250000.0)) tmp = Float64(x1 * Float64(Float64(x1 * 9.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.22e-15) || ~((x1 <= 250000.0))) tmp = x1 * ((x1 * 9.0) + -1.0); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.22e-15], N[Not[LessEqual[x1, 250000.0]], $MachinePrecision]], N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.22 \cdot 10^{-15} \lor \neg \left(x1 \leq 250000\right):\\
\;\;\;\;x1 \cdot \left(x1 \cdot 9 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.21999999999999991e-15 or 2.5e5 < x1 Initial program 34.4%
Simplified34.4%
Taylor expanded in x1 around 0 51.9%
Taylor expanded in x2 around 0 60.5%
Taylor expanded in x2 around 0 59.8%
Taylor expanded in x2 around 0 59.4%
if -1.21999999999999991e-15 < x1 < 2.5e5Initial program 99.5%
Simplified99.7%
Taylor expanded in x1 around 0 87.1%
Taylor expanded in x2 around 0 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x1 around 0 67.6%
*-commutative67.6%
mul-1-neg67.6%
unsub-neg67.6%
Simplified67.6%
Final simplification63.3%
(FPCore (x1 x2) :precision binary64 (* x2 (- (/ (* x1 (+ (* x1 9.0) -1.0)) x2) 6.0)))
double code(double x1, double x2) {
return x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (((x1 * ((x1 * 9.0d0) + (-1.0d0))) / x2) - 6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0);
}
def code(x1, x2): return x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0)
function code(x1, x2) return Float64(x2 * Float64(Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) / x2) - 6.0)) end
function tmp = code(x1, x2) tmp = x2 * (((x1 * ((x1 * 9.0) + -1.0)) / x2) - 6.0); end
code[x1_, x2_] := N[(x2 * N[(N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(\frac{x1 \cdot \left(x1 \cdot 9 + -1\right)}{x2} - 6\right)
\end{array}
Initial program 65.7%
Simplified65.8%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in x2 around inf 67.3%
Final simplification67.3%
(FPCore (x1 x2) :precision binary64 (+ (* x1 (+ (* x1 9.0) -1.0)) (* x2 -6.0)))
double code(double x1, double x2) {
return (x1 * ((x1 * 9.0) + -1.0)) + (x2 * -6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x1 * ((x1 * 9.0d0) + (-1.0d0))) + (x2 * (-6.0d0))
end function
public static double code(double x1, double x2) {
return (x1 * ((x1 * 9.0) + -1.0)) + (x2 * -6.0);
}
def code(x1, x2): return (x1 * ((x1 * 9.0) + -1.0)) + (x2 * -6.0)
function code(x1, x2) return Float64(Float64(x1 * Float64(Float64(x1 * 9.0) + -1.0)) + Float64(x2 * -6.0)) end
function tmp = code(x1, x2) tmp = (x1 * ((x1 * 9.0) + -1.0)) + (x2 * -6.0); end
code[x1_, x2_] := N[(N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 \cdot \left(x1 \cdot 9 + -1\right) + x2 \cdot -6
\end{array}
Initial program 65.7%
Simplified65.8%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 63.3%
*-commutative63.3%
Simplified63.3%
Final simplification63.3%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 65.7%
Simplified65.8%
Taylor expanded in x1 around 0 68.8%
Taylor expanded in x2 around 0 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in x1 around 0 34.2%
*-commutative34.2%
mul-1-neg34.2%
unsub-neg34.2%
Simplified34.2%
(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 65.7%
Simplified65.8%
Taylor expanded in x1 around 0 24.5%
*-commutative24.5%
Simplified24.5%
herbie shell --seed 2024135
(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))))))