
(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 25 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 (* 3.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (- -1.0 (* x1 x1)))
(t_4 (/ (- x1 t_2) t_3))
(t_5 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_6 (/ (- t_5 x1) (fma x1 x1 1.0)))
(t_7 (/ (- x1 t_5) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (- 6.0 (* t_4 4.0)))
(* (* (* x1 2.0) t_4) (+ 3.0 (/ (- t_2 x1) t_3))))
t_3)
(* t_1 t_4))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_0 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_6 4.0 -6.0)) (* (* x1 (* 2.0 t_7)) (- t_7 -3.0)))
(fma t_0 t_6 (pow x1 3.0))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = 3.0 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = -1.0 - (x1 * x1);
double t_4 = (x1 - t_2) / t_3;
double t_5 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_6 = (t_5 - x1) / fma(x1, x1, 1.0);
double t_7 = (x1 - t_5) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_4 * 4.0))) + (((x1 * 2.0) * t_4) * (3.0 + ((t_2 - x1) / t_3)))) * t_3) + (t_1 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_6, 4.0, -6.0)), ((x1 * (2.0 * t_7)) * (t_7 - -3.0))), fma(t_0, t_6, pow(x1, 3.0)))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(3.0 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(-1.0 - Float64(x1 * x1)) t_4 = Float64(Float64(x1 - t_2) / t_3) t_5 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_6 = Float64(Float64(t_5 - x1) / fma(x1, x1, 1.0)) t_7 = Float64(Float64(x1 - t_5) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_4 * 4.0))) + Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(3.0 + Float64(Float64(t_2 - x1) / t_3)))) * t_3) + Float64(t_1 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_0 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_6, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_7)) * Float64(t_7 - -3.0))), fma(t_0, t_6, (x1 ^ 3.0)))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$5 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 - t$95$5), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$4 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(3.0 + N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$1 * t$95$4), $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] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$6 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$7), $MachinePrecision]), $MachinePrecision] * N[(t$95$7 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$6 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := -1 - x1 \cdot x1\\
t_4 := \frac{x1 - t\_2}{t\_3}\\
t_5 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_6 := \frac{t\_5 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_7 := \frac{x1 - t\_5}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_4 \cdot 4\right) + \left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(3 + \frac{t\_2 - x1}{t\_3}\right)\right) \cdot t\_3 + t\_1 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_0 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_6, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_7\right)\right) \cdot \left(t\_7 - -3\right)\right), \mathsf{fma}\left(t\_0, t\_6, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf 13.4%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ (- x1 t_1) t_2))
(t_4
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (- 6.0 (* t_3 4.0)))
(* (* (* x1 2.0) t_3) (+ 3.0 (/ (- t_1 x1) t_2))))
t_2)
(* t_0 t_3))
(* x1 (* x1 x1))))))
(if (<=
(+ x1 (+ t_4 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
INFINITY)
(-
x1
(-
(*
3.0
(*
x2
(+
(/ 2.0 (fma x1 x1 1.0))
(/ (- x1 (* 3.0 (pow x1 2.0))) (* x2 (fma x1 x1 1.0))))))
t_4))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 - t_1) / t_2;
double t_4 = x1 + ((((((x1 * x1) * (6.0 - (t_3 * 4.0))) + (((x1 * 2.0) * t_3) * (3.0 + ((t_1 - x1) / t_2)))) * t_2) + (t_0 * t_3)) + (x1 * (x1 * x1)));
double tmp;
if ((x1 + (t_4 + (3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))))) <= ((double) INFINITY)) {
tmp = x1 - ((3.0 * (x2 * ((2.0 / fma(x1, x1, 1.0)) + ((x1 - (3.0 * pow(x1, 2.0))) / (x2 * fma(x1, x1, 1.0)))))) - t_4);
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(x1 - t_1) / t_2) t_4 = Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_3 * 4.0))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + Float64(Float64(t_1 - x1) / t_2)))) * t_2) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) tmp = 0.0 if (Float64(x1 + Float64(t_4 + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))))) <= Inf) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(x2 * Float64(Float64(2.0 / fma(x1, x1, 1.0)) + Float64(Float64(x1 - Float64(3.0 * (x1 ^ 2.0))) / Float64(x2 * fma(x1, x1, 1.0)))))) - t_4)); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$3 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(t$95$4 + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 - N[(N[(3.0 * N[(x2 * N[(N[(2.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 - N[(3.0 * N[Power[x1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x2 * N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t\_0 + 2 \cdot x2\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{x1 - t\_1}{t\_2}\\
t_4 := x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_3 \cdot 4\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + \frac{t\_1 - x1}{t\_2}\right)\right) \cdot t\_2 + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\\
\mathbf{if}\;x1 + \left(t\_4 + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \leq \infty:\\
\;\;\;\;x1 - \left(3 \cdot \left(x2 \cdot \left(\frac{2}{\mathsf{fma}\left(x1, x1, 1\right)} + \frac{x1 - 3 \cdot {x1}^{2}}{x2 \cdot \mathsf{fma}\left(x1, x1, 1\right)}\right)\right) - t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
Taylor expanded in x2 around inf 99.5%
+-commutative99.5%
associate--r+99.5%
associate-*r/99.5%
div-sub99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
associate-*r/99.5%
metadata-eval99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.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.4%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ t_1 (* 2.0 x2)))
(t_3 (/ (- x1 t_2) t_0))
(t_4
(+
x1
(+
(+
x1
(+
(+
(*
(+
(* (* x1 x1) (- 6.0 (* t_3 4.0)))
(* (* (* x1 2.0) t_3) (+ 3.0 (/ (- t_2 x1) t_0))))
t_0)
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))))
(if (<= t_4 INFINITY) t_4 (* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (x1 - t_2) / t_0;
double t_4 = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_3 * 4.0))) + (((x1 * 2.0) * t_3) * (3.0 + ((t_2 - x1) / t_0)))) * t_0) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))));
double tmp;
if (t_4 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = t_1 + (2.0 * x2);
double t_3 = (x1 - t_2) / t_0;
double t_4 = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_3 * 4.0))) + (((x1 * 2.0) * t_3) * (3.0 + ((t_2 - x1) / t_0)))) * t_0) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))));
double tmp;
if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_4;
} else {
tmp = 6.0 * Math.pow(x1, 4.0);
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = t_1 + (2.0 * x2) t_3 = (x1 - t_2) / t_0 t_4 = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_3 * 4.0))) + (((x1 * 2.0) * t_3) * (3.0 + ((t_2 - x1) / t_0)))) * t_0) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)))) tmp = 0 if t_4 <= math.inf: tmp = t_4 else: tmp = 6.0 * math.pow(x1, 4.0) return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(t_1 + Float64(2.0 * x2)) t_3 = Float64(Float64(x1 - t_2) / t_0) t_4 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_3 * 4.0))) + Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(3.0 + Float64(Float64(t_2 - x1) / t_0)))) * t_0) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))))) tmp = 0.0 if (t_4 <= Inf) tmp = t_4; else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = t_1 + (2.0 * x2); t_3 = (x1 - t_2) / t_0; t_4 = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_3 * 4.0))) + (((x1 * 2.0) * t_3) * (3.0 + ((t_2 - x1) / t_0)))) * t_0) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)))); tmp = 0.0; if (t_4 <= Inf) tmp = t_4; else tmp = 6.0 * (x1 ^ 4.0); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$3 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(3.0 + N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $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] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, Infinity], t$95$4, N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := t\_1 + 2 \cdot x2\\
t_3 := \frac{x1 - t\_2}{t\_0}\\
t_4 := x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_3 \cdot 4\right) + \left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(3 + \frac{t\_2 - x1}{t\_0}\right)\right) \cdot t\_0 + 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}{x1 \cdot x1 + 1}\right)\\
\mathbf{if}\;t\_4 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) < +inf.0Initial program 99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Taylor expanded in x1 around -inf 13.4%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 6.0 (pow x1 4.0)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (+ t_3 (* 2.0 x2)))
(t_5 (/ (- t_4 x1) t_0))
(t_6 (/ (- x1 t_4) t_0))
(t_7 (* (* x1 x1) (- 6.0 (* t_6 4.0))))
(t_8 (* x1 (* x1 x1))))
(if (<= x1 -5e+102)
t_2
(if (<= x1 -0.155)
(+
x1
(+
(+
x1
(+
(+ (* (+ t_7 (* (* (* x1 2.0) t_6) (+ 3.0 t_5))) t_0) (* t_3 t_6))
t_8))
9.0))
(if (<= x1 4e+74)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_1))
(+
x1
(-
t_8
(+
(* t_3 t_5)
(*
t_1
(+ t_7 (* (- t_6 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
t_2)))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 6.0 * pow(x1, 4.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * x1) * (6.0 - (t_6 * 4.0));
double t_8 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = t_2;
} else if (x1 <= -0.155) {
tmp = x1 + ((x1 + ((((t_7 + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_0) + (t_3 * t_6)) + t_8)) + 9.0);
} else if (x1 <= 4e+74) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_8 - ((t_3 * t_5) + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = (x1 * x1) + 1.0d0
t_2 = 6.0d0 * (x1 ** 4.0d0)
t_3 = x1 * (x1 * 3.0d0)
t_4 = t_3 + (2.0d0 * x2)
t_5 = (t_4 - x1) / t_0
t_6 = (x1 - t_4) / t_0
t_7 = (x1 * x1) * (6.0d0 - (t_6 * 4.0d0))
t_8 = x1 * (x1 * x1)
if (x1 <= (-5d+102)) then
tmp = t_2
else if (x1 <= (-0.155d0)) then
tmp = x1 + ((x1 + ((((t_7 + (((x1 * 2.0d0) * t_6) * (3.0d0 + t_5))) * t_0) + (t_3 * t_6)) + t_8)) + 9.0d0)
else if (x1 <= 4d+74) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (t_8 - ((t_3 * t_5) + (t_1 * (t_7 + ((t_6 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 6.0 * Math.pow(x1, 4.0);
double t_3 = x1 * (x1 * 3.0);
double t_4 = t_3 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * x1) * (6.0 - (t_6 * 4.0));
double t_8 = x1 * (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = t_2;
} else if (x1 <= -0.155) {
tmp = x1 + ((x1 + ((((t_7 + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_0) + (t_3 * t_6)) + t_8)) + 9.0);
} else if (x1 <= 4e+74) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_8 - ((t_3 * t_5) + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = (x1 * x1) + 1.0 t_2 = 6.0 * math.pow(x1, 4.0) t_3 = x1 * (x1 * 3.0) t_4 = t_3 + (2.0 * x2) t_5 = (t_4 - x1) / t_0 t_6 = (x1 - t_4) / t_0 t_7 = (x1 * x1) * (6.0 - (t_6 * 4.0)) t_8 = x1 * (x1 * x1) tmp = 0 if x1 <= -5e+102: tmp = t_2 elif x1 <= -0.155: tmp = x1 + ((x1 + ((((t_7 + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_0) + (t_3 * t_6)) + t_8)) + 9.0) elif x1 <= 4e+74: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_8 - ((t_3 * t_5) + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(6.0 * (x1 ^ 4.0)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(t_3 + Float64(2.0 * x2)) t_5 = Float64(Float64(t_4 - x1) / t_0) t_6 = Float64(Float64(x1 - t_4) / t_0) t_7 = Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_6 * 4.0))) t_8 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -5e+102) tmp = t_2; elseif (x1 <= -0.155) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(t_7 + Float64(Float64(Float64(x1 * 2.0) * t_6) * Float64(3.0 + t_5))) * t_0) + Float64(t_3 * t_6)) + t_8)) + 9.0)); elseif (x1 <= 4e+74) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(t_8 - Float64(Float64(t_3 * t_5) + Float64(t_1 * Float64(t_7 + Float64(Float64(t_6 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = (x1 * x1) + 1.0; t_2 = 6.0 * (x1 ^ 4.0); t_3 = x1 * (x1 * 3.0); t_4 = t_3 + (2.0 * x2); t_5 = (t_4 - x1) / t_0; t_6 = (x1 - t_4) / t_0; t_7 = (x1 * x1) * (6.0 - (t_6 * 4.0)); t_8 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -5e+102) tmp = t_2; elseif (x1 <= -0.155) tmp = x1 + ((x1 + ((((t_7 + (((x1 * 2.0) * t_6) * (3.0 + t_5))) * t_0) + (t_3 * t_6)) + t_8)) + 9.0); elseif (x1 <= 4e+74) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_1)) + (x1 + (t_8 - ((t_3 * t_5) + (t_1 * (t_7 + ((t_6 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); else tmp = t_2; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$6 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], t$95$2, If[LessEqual[x1, -0.155], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(t$95$7 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$3 * t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4e+74], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$8 - N[(N[(t$95$3 * t$95$5), $MachinePrecision] + N[(t$95$1 * N[(t$95$7 + N[(N[(t$95$6 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := 6 \cdot {x1}^{4}\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := t\_3 + 2 \cdot x2\\
t_5 := \frac{t\_4 - x1}{t\_0}\\
t_6 := \frac{x1 - t\_4}{t\_0}\\
t_7 := \left(x1 \cdot x1\right) \cdot \left(6 - t\_6 \cdot 4\right)\\
t_8 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -0.155:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(t\_7 + \left(\left(x1 \cdot 2\right) \cdot t\_6\right) \cdot \left(3 + t\_5\right)\right) \cdot t\_0 + t\_3 \cdot t\_6\right) + t\_8\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 4 \cdot 10^{+74}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(t\_8 - \left(t\_3 \cdot t\_5 + t\_1 \cdot \left(t\_7 + \left(t\_6 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -5e102 or 3.99999999999999981e74 < x1 Initial program 20.2%
Taylor expanded in x1 around -inf 31.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 97.6%
if -5e102 < x1 < -0.154999999999999999Initial program 99.1%
Taylor expanded in x1 around inf 99.1%
if -0.154999999999999999 < x1 < 3.99999999999999981e74Initial program 99.4%
Taylor expanded in x1 around 0 97.7%
+-commutative97.7%
mul-1-neg97.7%
sub-neg97.7%
Simplified97.7%
Final simplification97.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ t_0 (* 2.0 x2)))
(t_2 (* 6.0 (pow x1 4.0)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (- -1.0 (* x1 x1)))
(t_5 (/ (- x1 t_1) t_4))
(t_6 (- t_5 3.0))
(t_7 (* x1 (* x1 x1)))
(t_8 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3)))
(t_9 (* t_0 (/ (- t_1 x1) t_4))))
(if (<= x1 -5.6e+102)
t_2
(if (<= x1 -0.39)
(+
x1
(-
t_8
(-
(-
(-
t_9
(*
t_3
(+
(* (* (* x1 2.0) t_5) t_6)
(+ (* 4.0 (- (* 2.0 x2) 3.0)) (* x1 (- (* x1 6.0) 4.0))))))
t_7)
x1)))
(if (<= x1 7.6e+73)
(+
x1
(+
t_8
(+
x1
(-
t_7
(+
t_9
(*
t_3
(+
(* (* x1 x1) (- 6.0 (* t_5 4.0)))
(* t_6 (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
t_2)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = 6.0 * pow(x1, 4.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = (x1 - t_1) / t_4;
double t_6 = t_5 - 3.0;
double t_7 = x1 * (x1 * x1);
double t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double t_9 = t_0 * ((t_1 - x1) / t_4);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -0.39) {
tmp = x1 + (t_8 - (((t_9 - (t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 4.0)))))) - t_7) - x1));
} else if (x1 <= 7.6e+73) {
tmp = x1 + (t_8 + (x1 + (t_7 - (t_9 + (t_3 * (((x1 * x1) * (6.0 - (t_5 * 4.0))) + (t_6 * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: t_9
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = t_0 + (2.0d0 * x2)
t_2 = 6.0d0 * (x1 ** 4.0d0)
t_3 = (x1 * x1) + 1.0d0
t_4 = (-1.0d0) - (x1 * x1)
t_5 = (x1 - t_1) / t_4
t_6 = t_5 - 3.0d0
t_7 = x1 * (x1 * x1)
t_8 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)
t_9 = t_0 * ((t_1 - x1) / t_4)
if (x1 <= (-5.6d+102)) then
tmp = t_2
else if (x1 <= (-0.39d0)) then
tmp = x1 + (t_8 - (((t_9 - (t_3 * ((((x1 * 2.0d0) * t_5) * t_6) + ((4.0d0 * ((2.0d0 * x2) - 3.0d0)) + (x1 * ((x1 * 6.0d0) - 4.0d0)))))) - t_7) - x1))
else if (x1 <= 7.6d+73) then
tmp = x1 + (t_8 + (x1 + (t_7 - (t_9 + (t_3 * (((x1 * x1) * (6.0d0 - (t_5 * 4.0d0))) + (t_6 * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = t_0 + (2.0 * x2);
double t_2 = 6.0 * Math.pow(x1, 4.0);
double t_3 = (x1 * x1) + 1.0;
double t_4 = -1.0 - (x1 * x1);
double t_5 = (x1 - t_1) / t_4;
double t_6 = t_5 - 3.0;
double t_7 = x1 * (x1 * x1);
double t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3);
double t_9 = t_0 * ((t_1 - x1) / t_4);
double tmp;
if (x1 <= -5.6e+102) {
tmp = t_2;
} else if (x1 <= -0.39) {
tmp = x1 + (t_8 - (((t_9 - (t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 4.0)))))) - t_7) - x1));
} else if (x1 <= 7.6e+73) {
tmp = x1 + (t_8 + (x1 + (t_7 - (t_9 + (t_3 * (((x1 * x1) * (6.0 - (t_5 * 4.0))) + (t_6 * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = t_0 + (2.0 * x2) t_2 = 6.0 * math.pow(x1, 4.0) t_3 = (x1 * x1) + 1.0 t_4 = -1.0 - (x1 * x1) t_5 = (x1 - t_1) / t_4 t_6 = t_5 - 3.0 t_7 = x1 * (x1 * x1) t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3) t_9 = t_0 * ((t_1 - x1) / t_4) tmp = 0 if x1 <= -5.6e+102: tmp = t_2 elif x1 <= -0.39: tmp = x1 + (t_8 - (((t_9 - (t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 4.0)))))) - t_7) - x1)) elif x1 <= 7.6e+73: tmp = x1 + (t_8 + (x1 + (t_7 - (t_9 + (t_3 * (((x1 * x1) * (6.0 - (t_5 * 4.0))) + (t_6 * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(t_0 + Float64(2.0 * x2)) t_2 = Float64(6.0 * (x1 ^ 4.0)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(-1.0 - Float64(x1 * x1)) t_5 = Float64(Float64(x1 - t_1) / t_4) t_6 = Float64(t_5 - 3.0) t_7 = Float64(x1 * Float64(x1 * x1)) t_8 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)) t_9 = Float64(t_0 * Float64(Float64(t_1 - x1) / t_4)) tmp = 0.0 if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -0.39) tmp = Float64(x1 + Float64(t_8 - Float64(Float64(Float64(t_9 - Float64(t_3 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_5) * t_6) + Float64(Float64(4.0 * Float64(Float64(2.0 * x2) - 3.0)) + Float64(x1 * Float64(Float64(x1 * 6.0) - 4.0)))))) - t_7) - x1))); elseif (x1 <= 7.6e+73) tmp = Float64(x1 + Float64(t_8 + Float64(x1 + Float64(t_7 - Float64(t_9 + Float64(t_3 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_5 * 4.0))) + Float64(t_6 * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = t_0 + (2.0 * x2); t_2 = 6.0 * (x1 ^ 4.0); t_3 = (x1 * x1) + 1.0; t_4 = -1.0 - (x1 * x1); t_5 = (x1 - t_1) / t_4; t_6 = t_5 - 3.0; t_7 = x1 * (x1 * x1); t_8 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3); t_9 = t_0 * ((t_1 - x1) / t_4); tmp = 0.0; if (x1 <= -5.6e+102) tmp = t_2; elseif (x1 <= -0.39) tmp = x1 + (t_8 - (((t_9 - (t_3 * ((((x1 * 2.0) * t_5) * t_6) + ((4.0 * ((2.0 * x2) - 3.0)) + (x1 * ((x1 * 6.0) - 4.0)))))) - t_7) - x1)); elseif (x1 <= 7.6e+73) tmp = x1 + (t_8 + (x1 + (t_7 - (t_9 + (t_3 * (((x1 * x1) * (6.0 - (t_5 * 4.0))) + (t_6 * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); else tmp = t_2; 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - 3.0), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$0 * N[(N[(t$95$1 - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], t$95$2, If[LessEqual[x1, -0.39], N[(x1 + N[(t$95$8 - N[(N[(N[(t$95$9 - N[(t$95$3 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * t$95$6), $MachinePrecision] + N[(N[(4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(N[(x1 * 6.0), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 7.6e+73], N[(x1 + N[(t$95$8 + N[(x1 + N[(t$95$7 - N[(t$95$9 + N[(t$95$3 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$5 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := t\_0 + 2 \cdot x2\\
t_2 := 6 \cdot {x1}^{4}\\
t_3 := x1 \cdot x1 + 1\\
t_4 := -1 - x1 \cdot x1\\
t_5 := \frac{x1 - t\_1}{t\_4}\\
t_6 := t\_5 - 3\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
t_8 := 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_3}\\
t_9 := t\_0 \cdot \frac{t\_1 - x1}{t\_4}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -0.39:\\
\;\;\;\;x1 + \left(t\_8 - \left(\left(\left(t\_9 - t\_3 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot t\_6 + \left(4 \cdot \left(2 \cdot x2 - 3\right) + x1 \cdot \left(x1 \cdot 6 - 4\right)\right)\right)\right) - t\_7\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 7.6 \cdot 10^{+73}:\\
\;\;\;\;x1 + \left(t\_8 + \left(x1 + \left(t\_7 - \left(t\_9 + t\_3 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_5 \cdot 4\right) + t\_6 \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 7.60000000000000044e73 < x1 Initial program 20.2%
Taylor expanded in x1 around -inf 31.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 97.6%
if -5.60000000000000037e102 < x1 < -0.39000000000000001Initial program 99.1%
Taylor expanded in x1 around -inf 98.9%
Taylor expanded in x1 around 0 99.1%
if -0.39000000000000001 < x1 < 7.60000000000000044e73Initial program 99.4%
Taylor expanded in x1 around 0 97.7%
+-commutative97.7%
mul-1-neg97.7%
sub-neg97.7%
Simplified97.7%
Final simplification97.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)))
(t_3 (- -1.0 (* x1 x1)))
(t_4 (/ (- x1 t_2) t_3)))
(if (or (<= x1 -2.5e+23) (not (<= x1 1.85e+29)))
(*
(pow x1 4.0)
(- 6.0 (/ (- 3.0 (/ (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2)))) x1)) x1)))
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(-
(* x1 (* x1 x1))
(+
(* t_0 (/ (- t_2 x1) t_3))
(*
t_1
(+
(* (* x1 x1) (- 6.0 (* t_4 4.0)))
(* (- t_4 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2))))))))))))))
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);
double t_3 = -1.0 - (x1 * x1);
double t_4 = (x1 - t_2) / t_3;
double tmp;
if ((x1 <= -2.5e+23) || !(x1 <= 1.85e+29)) {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * ((t_2 - x1) / t_3)) + (t_1 * (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = t_0 + (2.0d0 * x2)
t_3 = (-1.0d0) - (x1 * x1)
t_4 = (x1 - t_2) / t_3
if ((x1 <= (-2.5d+23)) .or. (.not. (x1 <= 1.85d+29))) then
tmp = (x1 ** 4.0d0) * (6.0d0 - ((3.0d0 - ((9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))) / x1)) / x1))
else
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * ((t_2 - x1) / t_3)) + (t_1 * (((x1 * x1) * (6.0d0 - (t_4 * 4.0d0))) + ((t_4 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
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);
double t_3 = -1.0 - (x1 * x1);
double t_4 = (x1 - t_2) / t_3;
double tmp;
if ((x1 <= -2.5e+23) || !(x1 <= 1.85e+29)) {
tmp = Math.pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1));
} else {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * ((t_2 - x1) / t_3)) + (t_1 * (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
}
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) t_3 = -1.0 - (x1 * x1) t_4 = (x1 - t_2) / t_3 tmp = 0 if (x1 <= -2.5e+23) or not (x1 <= 1.85e+29): tmp = math.pow(x1, 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1)) else: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * ((t_2 - x1) / t_3)) + (t_1 * (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) 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(t_0 + Float64(2.0 * x2)) t_3 = Float64(-1.0 - Float64(x1 * x1)) t_4 = Float64(Float64(x1 - t_2) / t_3) tmp = 0.0 if ((x1 <= -2.5e+23) || !(x1 <= 1.85e+29)) tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))) / x1)) / x1))); else tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_0 * Float64(Float64(t_2 - x1) / t_3)) + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_4 * 4.0))) + Float64(Float64(t_4 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); 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); t_3 = -1.0 - (x1 * x1); t_4 = (x1 - t_2) / t_3; tmp = 0.0; if ((x1 <= -2.5e+23) || ~((x1 <= 1.85e+29))) tmp = (x1 ^ 4.0) * (6.0 - ((3.0 - ((9.0 - (4.0 * (3.0 - (2.0 * x2)))) / x1)) / x1)); else tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) - ((t_0 * ((t_2 - x1) / t_3)) + (t_1 * (((x1 * x1) * (6.0 - (t_4 * 4.0))) + ((t_4 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); 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[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 - t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[Or[LessEqual[x1, -2.5e+23], N[Not[LessEqual[x1, 1.85e+29]], $MachinePrecision]], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$0 * N[(N[(t$95$2 - x1), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$4 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * N[(x1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := t\_0 + 2 \cdot x2\\
t_3 := -1 - x1 \cdot x1\\
t_4 := \frac{x1 - t\_2}{t\_3}\\
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+23} \lor \neg \left(x1 \leq 1.85 \cdot 10^{+29}\right):\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{9 - 4 \cdot \left(3 - 2 \cdot x2\right)}{x1}}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_0 \cdot \frac{t\_2 - x1}{t\_3} + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_4 \cdot 4\right) + \left(t\_4 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5e23 or 1.84999999999999987e29 < x1 Initial program 37.2%
Taylor expanded in x1 around -inf 44.1%
Taylor expanded in x1 around inf 98.3%
Taylor expanded in x1 around -inf 98.3%
if -2.5e23 < x1 < 1.84999999999999987e29Initial program 99.4%
Taylor expanded in x1 around 0 97.7%
+-commutative97.7%
mul-1-neg97.7%
sub-neg97.7%
Simplified97.7%
Final simplification98.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* 6.0 (pow x1 4.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (- 3.0 (* 2.0 x2)))
(t_4 (+ t_2 (* 2.0 x2)))
(t_5 (/ (- t_4 x1) t_0))
(t_6 (/ (- x1 t_4) t_0))
(t_7 (* (* x1 2.0) t_6))
(t_8 (* t_7 (+ 3.0 t_5)))
(t_9 (* t_6 4.0))
(t_10 (* t_2 t_5))
(t_11 (* x1 (* x1 x1))))
(if (<= x1 -2e+105)
t_1
(if (<= x1 -0.185)
(+
x1
(+
(+
x1
(+ (+ (* (+ (* (* x1 x1) (- 6.0 t_9)) t_8) t_0) (* t_2 t_6)) t_11))
9.0))
(if (<= x1 0.0085)
(-
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(-
(- (+ t_10 (* (- (* (* x1 x1) (- t_9 6.0)) (* t_7 t_3)) t_0)) t_11)
x1)))
(if (<= x1 5.5e+90)
(+
x1
(+
9.0
(+
x1
(-
t_11
(+
t_10
(*
(+ (* x1 x1) 1.0)
(+
(*
(* x1 x1)
(- 6.0 (* 4.0 (+ 3.0 (/ (- -1.0 (/ t_3 x1)) x1)))))
t_8)))))))
t_1))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 - (2.0 * x2);
double t_4 = t_2 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * 2.0) * t_6;
double t_8 = t_7 * (3.0 + t_5);
double t_9 = t_6 * 4.0;
double t_10 = t_2 * t_5;
double t_11 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.185) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - t_9)) + t_8) * t_0) + (t_2 * t_6)) + t_11)) + 9.0);
} else if (x1 <= 0.0085) {
tmp = x1 - ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (((t_10 + ((((x1 * x1) * (t_9 - 6.0)) - (t_7 * t_3)) * t_0)) - t_11) - x1));
} else if (x1 <= 5.5e+90) {
tmp = x1 + (9.0 + (x1 + (t_11 - (t_10 + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - (t_3 / x1)) / x1))))) + t_8))))));
} 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_10
real(8) :: t_11
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: t_9
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = 6.0d0 * (x1 ** 4.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = 3.0d0 - (2.0d0 * x2)
t_4 = t_2 + (2.0d0 * x2)
t_5 = (t_4 - x1) / t_0
t_6 = (x1 - t_4) / t_0
t_7 = (x1 * 2.0d0) * t_6
t_8 = t_7 * (3.0d0 + t_5)
t_9 = t_6 * 4.0d0
t_10 = t_2 * t_5
t_11 = x1 * (x1 * x1)
if (x1 <= (-2d+105)) then
tmp = t_1
else if (x1 <= (-0.185d0)) then
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0d0 - t_9)) + t_8) * t_0) + (t_2 * t_6)) + t_11)) + 9.0d0)
else if (x1 <= 0.0085d0) then
tmp = x1 - ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (((t_10 + ((((x1 * x1) * (t_9 - 6.0d0)) - (t_7 * t_3)) * t_0)) - t_11) - x1))
else if (x1 <= 5.5d+90) then
tmp = x1 + (9.0d0 + (x1 + (t_11 - (t_10 + (((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 - (4.0d0 * (3.0d0 + (((-1.0d0) - (t_3 / x1)) / x1))))) + t_8))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * Math.pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = 3.0 - (2.0 * x2);
double t_4 = t_2 + (2.0 * x2);
double t_5 = (t_4 - x1) / t_0;
double t_6 = (x1 - t_4) / t_0;
double t_7 = (x1 * 2.0) * t_6;
double t_8 = t_7 * (3.0 + t_5);
double t_9 = t_6 * 4.0;
double t_10 = t_2 * t_5;
double t_11 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.185) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - t_9)) + t_8) * t_0) + (t_2 * t_6)) + t_11)) + 9.0);
} else if (x1 <= 0.0085) {
tmp = x1 - ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (((t_10 + ((((x1 * x1) * (t_9 - 6.0)) - (t_7 * t_3)) * t_0)) - t_11) - x1));
} else if (x1 <= 5.5e+90) {
tmp = x1 + (9.0 + (x1 + (t_11 - (t_10 + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - (t_3 / x1)) / x1))))) + t_8))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = 6.0 * math.pow(x1, 4.0) t_2 = x1 * (x1 * 3.0) t_3 = 3.0 - (2.0 * x2) t_4 = t_2 + (2.0 * x2) t_5 = (t_4 - x1) / t_0 t_6 = (x1 - t_4) / t_0 t_7 = (x1 * 2.0) * t_6 t_8 = t_7 * (3.0 + t_5) t_9 = t_6 * 4.0 t_10 = t_2 * t_5 t_11 = x1 * (x1 * x1) tmp = 0 if x1 <= -2e+105: tmp = t_1 elif x1 <= -0.185: tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - t_9)) + t_8) * t_0) + (t_2 * t_6)) + t_11)) + 9.0) elif x1 <= 0.0085: tmp = x1 - ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (((t_10 + ((((x1 * x1) * (t_9 - 6.0)) - (t_7 * t_3)) * t_0)) - t_11) - x1)) elif x1 <= 5.5e+90: tmp = x1 + (9.0 + (x1 + (t_11 - (t_10 + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - (t_3 / x1)) / x1))))) + t_8)))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(6.0 * (x1 ^ 4.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(3.0 - Float64(2.0 * x2)) t_4 = Float64(t_2 + Float64(2.0 * x2)) t_5 = Float64(Float64(t_4 - x1) / t_0) t_6 = Float64(Float64(x1 - t_4) / t_0) t_7 = Float64(Float64(x1 * 2.0) * t_6) t_8 = Float64(t_7 * Float64(3.0 + t_5)) t_9 = Float64(t_6 * 4.0) t_10 = Float64(t_2 * t_5) t_11 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.185) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - t_9)) + t_8) * t_0) + Float64(t_2 * t_6)) + t_11)) + 9.0)); elseif (x1 <= 0.0085) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(Float64(Float64(t_10 + Float64(Float64(Float64(Float64(x1 * x1) * Float64(t_9 - 6.0)) - Float64(t_7 * t_3)) * t_0)) - t_11) - x1))); elseif (x1 <= 5.5e+90) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_11 - Float64(t_10 + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * Float64(3.0 + Float64(Float64(-1.0 - Float64(t_3 / x1)) / x1))))) + t_8))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = 6.0 * (x1 ^ 4.0); t_2 = x1 * (x1 * 3.0); t_3 = 3.0 - (2.0 * x2); t_4 = t_2 + (2.0 * x2); t_5 = (t_4 - x1) / t_0; t_6 = (x1 - t_4) / t_0; t_7 = (x1 * 2.0) * t_6; t_8 = t_7 * (3.0 + t_5); t_9 = t_6 * 4.0; t_10 = t_2 * t_5; t_11 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.185) tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - t_9)) + t_8) * t_0) + (t_2 * t_6)) + t_11)) + 9.0); elseif (x1 <= 0.0085) tmp = x1 - ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (((t_10 + ((((x1 * x1) * (t_9 - 6.0)) - (t_7 * t_3)) * t_0)) - t_11) - x1)); elseif (x1 <= 5.5e+90) tmp = x1 + (9.0 + (x1 + (t_11 - (t_10 + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - (t_3 / x1)) / x1))))) + t_8)))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 - t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$7 * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$6 * 4.0), $MachinePrecision]}, Block[{t$95$10 = N[(t$95$2 * t$95$5), $MachinePrecision]}, Block[{t$95$11 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+105], t$95$1, If[LessEqual[x1, -0.185], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - t$95$9), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$2 * t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$11), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.0085], 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[(N[(N[(t$95$10 + N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(t$95$9 - 6.0), $MachinePrecision]), $MachinePrecision] - N[(t$95$7 * t$95$3), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - t$95$11), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.5e+90], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$11 - N[(t$95$10 + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * N[(3.0 + N[(N[(-1.0 - N[(t$95$3 / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := 3 - 2 \cdot x2\\
t_4 := t\_2 + 2 \cdot x2\\
t_5 := \frac{t\_4 - x1}{t\_0}\\
t_6 := \frac{x1 - t\_4}{t\_0}\\
t_7 := \left(x1 \cdot 2\right) \cdot t\_6\\
t_8 := t\_7 \cdot \left(3 + t\_5\right)\\
t_9 := t\_6 \cdot 4\\
t_10 := t\_2 \cdot t\_5\\
t_11 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -0.185:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_9\right) + t\_8\right) \cdot t\_0 + t\_2 \cdot t\_6\right) + t\_11\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 0.0085:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(\left(\left(t\_10 + \left(\left(x1 \cdot x1\right) \cdot \left(t\_9 - 6\right) - t\_7 \cdot t\_3\right) \cdot t\_0\right) - t\_11\right) - x1\right)\right)\\
\mathbf{elif}\;x1 \leq 5.5 \cdot 10^{+90}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_11 - \left(t\_10 + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 - \frac{t\_3}{x1}}{x1}\right)\right) + t\_8\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.9999999999999999e105 or 5.49999999999999999e90 < x1 Initial program 14.1%
Taylor expanded in x1 around -inf 25.6%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
if -1.9999999999999999e105 < x1 < -0.185Initial program 99.1%
Taylor expanded in x1 around inf 99.1%
if -0.185 < x1 < 0.0085000000000000006Initial program 99.5%
Taylor expanded in x1 around 0 98.9%
if 0.0085000000000000006 < x1 < 5.49999999999999999e90Initial program 99.4%
Taylor expanded in x1 around -inf 99.6%
Taylor expanded in x1 around inf 99.6%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* 6.0 (pow x1 4.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- t_3 x1) t_0))
(t_5
(+
x1
(+
9.0
(+
x1
(-
(* x1 (* x1 x1))
(+
(* t_2 t_4)
(*
(+ (* x1 x1) 1.0)
(+
(*
(* x1 x1)
(-
6.0
(* 4.0 (+ 3.0 (/ (- -1.0 (/ (- 3.0 (* 2.0 x2)) x1)) x1)))))
(* (* (* x1 2.0) (/ (- x1 t_3) t_0)) (+ 3.0 t_4)))))))))))
(if (<= x1 -2e+105)
t_1
(if (<= x1 -0.165)
t_5
(if (<= x1 0.0012)
(+
x1
(-
(+ x1 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))
(-
(* x1 (- 3.0 (* x2 (+ (* x1 6.0) (* 9.0 (/ x1 x2))))))
(* x2 -6.0))))
(if (<= x1 2e+89) t_5 t_1))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + (((x1 * 2.0) * ((x1 - t_3) / t_0)) * (3.0 + t_4))))))));
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.165) {
tmp = t_5;
} else if (x1 <= 0.0012) {
tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0)));
} else if (x1 <= 2e+89) {
tmp = t_5;
} 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) :: t_5
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = 6.0d0 * (x1 ** 4.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = (t_3 - x1) / t_0
t_5 = x1 + (9.0d0 + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_4) + (((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 - (4.0d0 * (3.0d0 + (((-1.0d0) - ((3.0d0 - (2.0d0 * x2)) / x1)) / x1))))) + (((x1 * 2.0d0) * ((x1 - t_3) / t_0)) * (3.0d0 + t_4))))))))
if (x1 <= (-2d+105)) then
tmp = t_1
else if (x1 <= (-0.165d0)) then
tmp = t_5
else if (x1 <= 0.0012d0) then
tmp = x1 + ((x1 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))) - ((x1 * (3.0d0 - (x2 * ((x1 * 6.0d0) + (9.0d0 * (x1 / x2)))))) - (x2 * (-6.0d0))))
else if (x1 <= 2d+89) then
tmp = t_5
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * Math.pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + (((x1 * 2.0) * ((x1 - t_3) / t_0)) * (3.0 + t_4))))))));
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.165) {
tmp = t_5;
} else if (x1 <= 0.0012) {
tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0)));
} else if (x1 <= 2e+89) {
tmp = t_5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = 6.0 * math.pow(x1, 4.0) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = (t_3 - x1) / t_0 t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + (((x1 * 2.0) * ((x1 - t_3) / t_0)) * (3.0 + t_4)))))))) tmp = 0 if x1 <= -2e+105: tmp = t_1 elif x1 <= -0.165: tmp = t_5 elif x1 <= 0.0012: tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0))) elif x1 <= 2e+89: tmp = t_5 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(6.0 * (x1 ^ 4.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / t_0) t_5 = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_2 * t_4) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * Float64(3.0 + Float64(Float64(-1.0 - Float64(Float64(3.0 - Float64(2.0 * x2)) / x1)) / x1))))) + Float64(Float64(Float64(x1 * 2.0) * Float64(Float64(x1 - t_3) / t_0)) * Float64(3.0 + t_4))))))))) tmp = 0.0 if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.165) tmp = t_5; elseif (x1 <= 0.0012) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))) - Float64(Float64(x1 * Float64(3.0 - Float64(x2 * Float64(Float64(x1 * 6.0) + Float64(9.0 * Float64(x1 / x2)))))) - Float64(x2 * -6.0)))); elseif (x1 <= 2e+89) tmp = t_5; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = 6.0 * (x1 ^ 4.0); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = (t_3 - x1) / t_0; t_5 = x1 + (9.0 + (x1 + ((x1 * (x1 * x1)) - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + (((x1 * 2.0) * ((x1 - t_3) / t_0)) * (3.0 + t_4)))))))); tmp = 0.0; if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.165) tmp = t_5; elseif (x1 <= 0.0012) tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0))); elseif (x1 <= 2e+89) tmp = t_5; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(9.0 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * t$95$4), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * N[(3.0 + N[(N[(-1.0 - N[(N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x1 * 2.0), $MachinePrecision] * N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+105], t$95$1, If[LessEqual[x1, -0.165], t$95$5, If[LessEqual[x1, 0.0012], N[(x1 + N[(N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * N[(3.0 - N[(x2 * N[(N[(x1 * 6.0), $MachinePrecision] + N[(9.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+89], t$95$5, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
t_4 := \frac{t\_3 - x1}{t\_0}\\
t_5 := x1 + \left(9 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_2 \cdot t\_4 + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 - \frac{3 - 2 \cdot x2}{x1}}{x1}\right)\right) + \left(\left(x1 \cdot 2\right) \cdot \frac{x1 - t\_3}{t\_0}\right) \cdot \left(3 + t\_4\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -0.165:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 0.0012:\\
\;\;\;\;x1 + \left(\left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right) - \left(x1 \cdot \left(3 - x2 \cdot \left(x1 \cdot 6 + 9 \cdot \frac{x1}{x2}\right)\right) - x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+89}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.9999999999999999e105 or 1.99999999999999999e89 < x1 Initial program 14.1%
Taylor expanded in x1 around -inf 25.6%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
if -1.9999999999999999e105 < x1 < -0.165000000000000008 or 0.00119999999999999989 < x1 < 1.99999999999999999e89Initial program 99.2%
Taylor expanded in x1 around -inf 99.2%
Taylor expanded in x1 around inf 99.2%
if -0.165000000000000008 < x1 < 0.00119999999999999989Initial program 99.5%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x2 around 0 98.9%
Taylor expanded in x2 around inf 98.9%
Final simplification99.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- -1.0 (* x1 x1)))
(t_1 (* 6.0 (pow x1 4.0)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4 (/ (- t_3 x1) t_0))
(t_5 (/ (- x1 t_3) t_0))
(t_6 (* (* (* x1 2.0) t_5) (+ 3.0 t_4)))
(t_7 (* x1 (* x1 x1))))
(if (<= x1 -2e+105)
t_1
(if (<= x1 -0.15)
(+
x1
(+
(+
x1
(+
(+ (* (+ (* (* x1 x1) (- 6.0 (* t_5 4.0))) t_6) t_0) (* t_2 t_5))
t_7))
9.0))
(if (<= x1 0.0006)
(+
x1
(-
(+ x1 (* x2 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))
(-
(* x1 (- 3.0 (* x2 (+ (* x1 6.0) (* 9.0 (/ x1 x2))))))
(* x2 -6.0))))
(if (<= x1 5.8e+90)
(+
x1
(+
9.0
(+
x1
(-
t_7
(+
(* t_2 t_4)
(*
(+ (* x1 x1) 1.0)
(+
(*
(* x1 x1)
(-
6.0
(* 4.0 (+ 3.0 (/ (- -1.0 (/ (- 3.0 (* 2.0 x2)) x1)) x1)))))
t_6)))))))
t_1))))))
double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = (x1 - t_3) / t_0;
double t_6 = ((x1 * 2.0) * t_5) * (3.0 + t_4);
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.15) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_5 * 4.0))) + t_6) * t_0) + (t_2 * t_5)) + t_7)) + 9.0);
} else if (x1 <= 0.0006) {
tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0)));
} else if (x1 <= 5.8e+90) {
tmp = x1 + (9.0 + (x1 + (t_7 - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + t_6))))));
} 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) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = 6.0d0 * (x1 ** 4.0d0)
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = (t_3 - x1) / t_0
t_5 = (x1 - t_3) / t_0
t_6 = ((x1 * 2.0d0) * t_5) * (3.0d0 + t_4)
t_7 = x1 * (x1 * x1)
if (x1 <= (-2d+105)) then
tmp = t_1
else if (x1 <= (-0.15d0)) then
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0d0 - (t_5 * 4.0d0))) + t_6) * t_0) + (t_2 * t_5)) + t_7)) + 9.0d0)
else if (x1 <= 0.0006d0) then
tmp = x1 + ((x1 + (x2 * ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))) - ((x1 * (3.0d0 - (x2 * ((x1 * 6.0d0) + (9.0d0 * (x1 / x2)))))) - (x2 * (-6.0d0))))
else if (x1 <= 5.8d+90) then
tmp = x1 + (9.0d0 + (x1 + (t_7 - ((t_2 * t_4) + (((x1 * x1) + 1.0d0) * (((x1 * x1) * (6.0d0 - (4.0d0 * (3.0d0 + (((-1.0d0) - ((3.0d0 - (2.0d0 * x2)) / x1)) / x1))))) + t_6))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = -1.0 - (x1 * x1);
double t_1 = 6.0 * Math.pow(x1, 4.0);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = (t_3 - x1) / t_0;
double t_5 = (x1 - t_3) / t_0;
double t_6 = ((x1 * 2.0) * t_5) * (3.0 + t_4);
double t_7 = x1 * (x1 * x1);
double tmp;
if (x1 <= -2e+105) {
tmp = t_1;
} else if (x1 <= -0.15) {
tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_5 * 4.0))) + t_6) * t_0) + (t_2 * t_5)) + t_7)) + 9.0);
} else if (x1 <= 0.0006) {
tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0)));
} else if (x1 <= 5.8e+90) {
tmp = x1 + (9.0 + (x1 + (t_7 - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + t_6))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = -1.0 - (x1 * x1) t_1 = 6.0 * math.pow(x1, 4.0) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = (t_3 - x1) / t_0 t_5 = (x1 - t_3) / t_0 t_6 = ((x1 * 2.0) * t_5) * (3.0 + t_4) t_7 = x1 * (x1 * x1) tmp = 0 if x1 <= -2e+105: tmp = t_1 elif x1 <= -0.15: tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_5 * 4.0))) + t_6) * t_0) + (t_2 * t_5)) + t_7)) + 9.0) elif x1 <= 0.0006: tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0))) elif x1 <= 5.8e+90: tmp = x1 + (9.0 + (x1 + (t_7 - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + t_6)))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(-1.0 - Float64(x1 * x1)) t_1 = Float64(6.0 * (x1 ^ 4.0)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) t_4 = Float64(Float64(t_3 - x1) / t_0) t_5 = Float64(Float64(x1 - t_3) / t_0) t_6 = Float64(Float64(Float64(x1 * 2.0) * t_5) * Float64(3.0 + t_4)) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.15) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(t_5 * 4.0))) + t_6) * t_0) + Float64(t_2 * t_5)) + t_7)) + 9.0)); elseif (x1 <= 0.0006) tmp = Float64(x1 + Float64(Float64(x1 + Float64(x2 * Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))) - Float64(Float64(x1 * Float64(3.0 - Float64(x2 * Float64(Float64(x1 * 6.0) + Float64(9.0 * Float64(x1 / x2)))))) - Float64(x2 * -6.0)))); elseif (x1 <= 5.8e+90) tmp = Float64(x1 + Float64(9.0 + Float64(x1 + Float64(t_7 - Float64(Float64(t_2 * t_4) + Float64(Float64(Float64(x1 * x1) + 1.0) * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(4.0 * Float64(3.0 + Float64(Float64(-1.0 - Float64(Float64(3.0 - Float64(2.0 * x2)) / x1)) / x1))))) + t_6))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = -1.0 - (x1 * x1); t_1 = 6.0 * (x1 ^ 4.0); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = (t_3 - x1) / t_0; t_5 = (x1 - t_3) / t_0; t_6 = ((x1 * 2.0) * t_5) * (3.0 + t_4); t_7 = x1 * (x1 * x1); tmp = 0.0; if (x1 <= -2e+105) tmp = t_1; elseif (x1 <= -0.15) tmp = x1 + ((x1 + ((((((x1 * x1) * (6.0 - (t_5 * 4.0))) + t_6) * t_0) + (t_2 * t_5)) + t_7)) + 9.0); elseif (x1 <= 0.0006) tmp = x1 + ((x1 + (x2 * ((x1 * -12.0) + (8.0 * (x1 * x2))))) - ((x1 * (3.0 - (x2 * ((x1 * 6.0) + (9.0 * (x1 / x2)))))) - (x2 * -6.0))); elseif (x1 <= 5.8e+90) tmp = x1 + (9.0 + (x1 + (t_7 - ((t_2 * t_4) + (((x1 * x1) + 1.0) * (((x1 * x1) * (6.0 - (4.0 * (3.0 + ((-1.0 - ((3.0 - (2.0 * x2)) / x1)) / x1))))) + t_6)))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -2e+105], t$95$1, If[LessEqual[x1, -0.15], N[(x1 + N[(N[(x1 + N[(N[(N[(N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(t$95$5 * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 0.0006], N[(x1 + N[(N[(x1 + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x1 * N[(3.0 - N[(x2 * N[(N[(x1 * 6.0), $MachinePrecision] + N[(9.0 * N[(x1 / x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.8e+90], N[(x1 + N[(9.0 + N[(x1 + N[(t$95$7 - N[(N[(t$95$2 * t$95$4), $MachinePrecision] + N[(N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(4.0 * N[(3.0 + N[(N[(-1.0 - N[(N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 - x1 \cdot x1\\
t_1 := 6 \cdot {x1}^{4}\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
t_4 := \frac{t\_3 - x1}{t\_0}\\
t_5 := \frac{x1 - t\_3}{t\_0}\\
t_6 := \left(\left(x1 \cdot 2\right) \cdot t\_5\right) \cdot \left(3 + t\_4\right)\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 \leq -2 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -0.15:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(\left(\left(x1 \cdot x1\right) \cdot \left(6 - t\_5 \cdot 4\right) + t\_6\right) \cdot t\_0 + t\_2 \cdot t\_5\right) + t\_7\right)\right) + 9\right)\\
\mathbf{elif}\;x1 \leq 0.0006:\\
\;\;\;\;x1 + \left(\left(x1 + x2 \cdot \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right) - \left(x1 \cdot \left(3 - x2 \cdot \left(x1 \cdot 6 + 9 \cdot \frac{x1}{x2}\right)\right) - x2 \cdot -6\right)\right)\\
\mathbf{elif}\;x1 \leq 5.8 \cdot 10^{+90}:\\
\;\;\;\;x1 + \left(9 + \left(x1 + \left(t\_7 - \left(t\_2 \cdot t\_4 + \left(x1 \cdot x1 + 1\right) \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - 4 \cdot \left(3 + \frac{-1 - \frac{3 - 2 \cdot x2}{x1}}{x1}\right)\right) + t\_6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -1.9999999999999999e105 or 5.8000000000000003e90 < x1 Initial program 14.1%
Taylor expanded in x1 around -inf 25.6%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
if -1.9999999999999999e105 < x1 < -0.149999999999999994Initial program 99.1%
Taylor expanded in x1 around inf 99.1%
if -0.149999999999999994 < x1 < 5.99999999999999947e-4Initial program 99.5%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x1 around 0 85.2%
Taylor expanded in x2 around 0 98.9%
Taylor expanded in x2 around inf 98.9%
if 5.99999999999999947e-4 < x1 < 5.8000000000000003e90Initial program 99.4%
Taylor expanded in x1 around -inf 99.6%
Taylor expanded in x1 around inf 99.6%
Final simplification99.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -12000000000.0) (not (<= x1 1.25e+24))) (* 6.0 (pow x1 4.0)) (+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -12000000000.0) || !(x1 <= 1.25e+24)) {
tmp = 6.0 * pow(x1, 4.0);
} else {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.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 <= (-12000000000.0d0)) .or. (.not. (x1 <= 1.25d+24))) then
tmp = 6.0d0 * (x1 ** 4.0d0)
else
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -12000000000.0) || !(x1 <= 1.25e+24)) {
tmp = 6.0 * Math.pow(x1, 4.0);
} else {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -12000000000.0) or not (x1 <= 1.25e+24): tmp = 6.0 * math.pow(x1, 4.0) else: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -12000000000.0) || !(x1 <= 1.25e+24)) tmp = Float64(6.0 * (x1 ^ 4.0)); else tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -12000000000.0) || ~((x1 <= 1.25e+24))) tmp = 6.0 * (x1 ^ 4.0); else tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -12000000000.0], N[Not[LessEqual[x1, 1.25e+24]], $MachinePrecision]], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -12000000000 \lor \neg \left(x1 \leq 1.25 \cdot 10^{+24}\right):\\
\;\;\;\;6 \cdot {x1}^{4}\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.2e10 or 1.25000000000000011e24 < x1 Initial program 41.0%
Taylor expanded in x1 around -inf 45.8%
Taylor expanded in x1 around inf 96.7%
Taylor expanded in x1 around inf 90.1%
if -1.2e10 < x1 < 1.25000000000000011e24Initial program 99.5%
Taylor expanded in x1 around 0 84.5%
Taylor expanded in x1 around 0 83.9%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x2 around 0 97.6%
Final simplification94.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -210000000.0)
(* (pow x1 4.0) (- 6.0 (/ 3.0 x1)))
(if (<= x1 2.9e+25)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(* 6.0 (pow x1 4.0)))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -210000000.0) {
tmp = pow(x1, 4.0) * (6.0 - (3.0 / x1));
} else if (x1 <= 2.9e+25) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = 6.0 * pow(x1, 4.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-210000000.0d0)) then
tmp = (x1 ** 4.0d0) * (6.0d0 - (3.0d0 / x1))
else if (x1 <= 2.9d+25) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else
tmp = 6.0d0 * (x1 ** 4.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -210000000.0) {
tmp = Math.pow(x1, 4.0) * (6.0 - (3.0 / x1));
} else if (x1 <= 2.9e+25) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = 6.0 * Math.pow(x1, 4.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -210000000.0: tmp = math.pow(x1, 4.0) * (6.0 - (3.0 / x1)) elif x1 <= 2.9e+25: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) else: tmp = 6.0 * math.pow(x1, 4.0) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -210000000.0) tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 / x1))); elseif (x1 <= 2.9e+25) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); else tmp = Float64(6.0 * (x1 ^ 4.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -210000000.0) tmp = (x1 ^ 4.0) * (6.0 - (3.0 / x1)); elseif (x1 <= 2.9e+25) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); else tmp = 6.0 * (x1 ^ 4.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -210000000.0], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.9e+25], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -210000000:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)\\
\mathbf{elif}\;x1 \leq 2.9 \cdot 10^{+25}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot {x1}^{4}\\
\end{array}
\end{array}
if x1 < -2.1e8Initial program 37.2%
Taylor expanded in x1 around -inf 46.9%
Taylor expanded in x1 around inf 93.3%
Taylor expanded in x1 around inf 87.3%
associate-*r/87.3%
metadata-eval87.3%
Simplified87.3%
if -2.1e8 < x1 < 2.8999999999999999e25Initial program 99.5%
Taylor expanded in x1 around 0 84.5%
Taylor expanded in x1 around 0 83.9%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x2 around 0 97.6%
if 2.8999999999999999e25 < x1 Initial program 44.6%
Taylor expanded in x1 around -inf 44.8%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 93.4%
Final simplification94.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (* x1 (* x1 3.0)))
(t_3 (+ t_2 (* 2.0 x2)))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(-
(* x1 (* x1 x1))
(+
(* t_2 (/ (- t_3 x1) t_1))
(*
t_0
(-
(* (* x1 x1) (- 6.0 (* (/ (- x1 t_3) t_1) 4.0)))
-6.0)))))))))
(if (<= x1 -5e+102)
(+
9.0
(* x1 (+ 2.0 (* x1 (- 9.0 (- (* 4.0 (- 3.0 (* 2.0 x2))) (* x1 -3.0)))))))
(if (<= x1 -62000000.0)
t_4
(if (<= x1 1.25e+24)
(+
x1
(- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(if (<= x1 5e+153) t_4 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = -1.0 - (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * ((t_3 - x1) / t_1)) + (t_0 * (((x1 * x1) * (6.0 - (((x1 - t_3) / t_1) * 4.0))) - -6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= -62000000.0) {
tmp = t_4;
} else if (x1 <= 1.25e+24) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = (-1.0d0) - (x1 * x1)
t_2 = x1 * (x1 * 3.0d0)
t_3 = t_2 + (2.0d0 * x2)
t_4 = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * ((t_3 - x1) / t_1)) + (t_0 * (((x1 * x1) * (6.0d0 - (((x1 - t_3) / t_1) * 4.0d0))) - (-6.0d0)))))))
if (x1 <= (-5d+102)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - ((4.0d0 * (3.0d0 - (2.0d0 * x2))) - (x1 * (-3.0d0)))))))
else if (x1 <= (-62000000.0d0)) then
tmp = t_4
else if (x1 <= 1.25d+24) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else if (x1 <= 5d+153) then
tmp = t_4
else
tmp = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = -1.0 - (x1 * x1);
double t_2 = x1 * (x1 * 3.0);
double t_3 = t_2 + (2.0 * x2);
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * ((t_3 - x1) / t_1)) + (t_0 * (((x1 * x1) * (6.0 - (((x1 - t_3) / t_1) * 4.0))) - -6.0))))));
double tmp;
if (x1 <= -5e+102) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= -62000000.0) {
tmp = t_4;
} else if (x1 <= 1.25e+24) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= 5e+153) {
tmp = t_4;
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = -1.0 - (x1 * x1) t_2 = x1 * (x1 * 3.0) t_3 = t_2 + (2.0 * x2) t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * ((t_3 - x1) / t_1)) + (t_0 * (((x1 * x1) * (6.0 - (((x1 - t_3) / t_1) * 4.0))) - -6.0)))))) tmp = 0 if x1 <= -5e+102: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))) elif x1 <= -62000000.0: tmp = t_4 elif x1 <= 1.25e+24: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) elif x1 <= 5e+153: tmp = t_4 else: tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(t_2 + Float64(2.0 * x2)) 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 * Float64(Float64(t_3 - x1) / t_1)) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 - Float64(Float64(Float64(x1 - t_3) / t_1) * 4.0))) - -6.0))))))) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(Float64(4.0 * Float64(3.0 - Float64(2.0 * x2))) - Float64(x1 * -3.0))))))); elseif (x1 <= -62000000.0) tmp = t_4; elseif (x1 <= 1.25e+24) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = -1.0 - (x1 * x1); t_2 = x1 * (x1 * 3.0); t_3 = t_2 + (2.0 * x2); t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) - ((t_2 * ((t_3 - x1) / t_1)) + (t_0 * (((x1 * x1) * (6.0 - (((x1 - t_3) / t_1) * 4.0))) - -6.0)))))); tmp = 0.0; if (x1 <= -5e+102) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))); elseif (x1 <= -62000000.0) tmp = t_4; elseif (x1 <= 1.25e+24) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); elseif (x1 <= 5e+153) tmp = t_4; else tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $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 * N[(N[(t$95$3 - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 - N[(N[(N[(x1 - t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -62000000.0], t$95$4, If[LessEqual[x1, 1.25e+24], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], t$95$4, N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := t\_2 + 2 \cdot x2\\
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 \frac{t\_3 - x1}{t\_1} + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 - \frac{x1 - t\_3}{t\_1} \cdot 4\right) - -6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - \left(4 \cdot \left(3 - 2 \cdot x2\right) - x1 \cdot -3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -62000000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.25 \cdot 10^{+24}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 0.0%
Taylor expanded in x1 around -inf 25.7%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around 0 97.1%
if -5e102 < x1 < -6.2e7 or 1.25000000000000011e24 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 91.5%
Taylor expanded in x1 around inf 91.5%
if -6.2e7 < x1 < 1.25000000000000011e24Initial program 99.5%
Taylor expanded in x1 around 0 84.5%
Taylor expanded in x1 around 0 83.9%
Taylor expanded in x1 around 0 84.6%
Taylor expanded in x2 around 0 97.6%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
Final simplification96.7%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+23)
(+
9.0
(* x1 (+ 2.0 (* x1 (- 9.0 (- (* 4.0 (- 3.0 (* 2.0 x2))) (* x1 -3.0)))))))
(if (<= x1 2.65e+91)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(if (<= x1 5e+153)
(+
x1
(+
(* 3.0 (/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) (* x2 8.0)))))
(+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 2.65e+91) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x2 * 8.0))));
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.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.5d+23)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - ((4.0d0 * (3.0d0 - (2.0d0 * x2))) - (x1 * (-3.0d0)))))))
else if (x1 <= 2.65d+91) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + ((x1 * (x1 * x1)) + (x2 * 8.0d0))))
else
tmp = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 2.65e+91) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x2 * 8.0))));
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+23: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))) elif x1 <= 2.65e+91: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) elif x1 <= 5e+153: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x2 * 8.0)))) else: tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+23) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(Float64(4.0 * Float64(3.0 - Float64(2.0 * x2))) - Float64(x1 * -3.0))))))); elseif (x1 <= 2.65e+91) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(x2 * 8.0))))); else tmp = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+23) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))); elseif (x1 <= 2.65e+91) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + (x2 * 8.0)))); else tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+23], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.65e+91], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+23}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - \left(4 \cdot \left(3 - 2 \cdot x2\right) - x1 \cdot -3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 2.65 \cdot 10^{+91}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + x2 \cdot 8\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5e23Initial program 28.4%
Taylor expanded in x1 around -inf 43.2%
Taylor expanded in x1 around inf 96.3%
Taylor expanded in x1 around 0 77.2%
if -2.5e23 < x1 < 2.64999999999999998e91Initial program 99.4%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x1 around 0 75.9%
Taylor expanded in x1 around 0 76.1%
Taylor expanded in x2 around 0 87.4%
if 2.64999999999999998e91 < x1 < 5.00000000000000018e153Initial program 100.0%
Taylor expanded in x1 around -inf 100.0%
Taylor expanded in x2 around inf 51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in x1 around 0 81.9%
*-commutative81.9%
Simplified81.9%
if 5.00000000000000018e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
Final simplification86.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+23)
(+
9.0
(* x1 (+ 2.0 (* x1 (- 9.0 (- (* 4.0 (- 3.0 (* 2.0 x2))) (* x1 -3.0)))))))
(if (<= x1 3.3e+24)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(+
x1
(+
(+ x1 (* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))
(*
3.0
(+ (* x2 -2.0) (* x1 (- -1.0 (* x1 (- (* x2 -2.0) (+ x1 3.0))))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 3.3e+24) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - (x1 + 3.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.5d+23)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - ((4.0d0 * (3.0d0 - (2.0d0 * x2))) - (x1 * (-3.0d0)))))))
else if (x1 <= 3.3d+24) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else
tmp = x1 + ((x1 + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))) + (3.0d0 * ((x2 * (-2.0d0)) + (x1 * ((-1.0d0) - (x1 * ((x2 * (-2.0d0)) - (x1 + 3.0d0))))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 3.3e+24) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - (x1 + 3.0))))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+23: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))) elif x1 <= 3.3e+24: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) else: tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - (x1 + 3.0)))))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+23) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(Float64(4.0 * Float64(3.0 - Float64(2.0 * x2))) - Float64(x1 * -3.0))))))); elseif (x1 <= 3.3e+24) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) + Float64(x1 * Float64(-1.0 - Float64(x1 * Float64(Float64(x2 * -2.0) - Float64(x1 + 3.0))))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+23) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))); elseif (x1 <= 3.3e+24) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); else tmp = x1 + ((x1 + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))) + (3.0 * ((x2 * -2.0) + (x1 * (-1.0 - (x1 * ((x2 * -2.0) - (x1 + 3.0)))))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+23], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.3e+24], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x1 * N[(N[(x2 * -2.0), $MachinePrecision] - N[(x1 + 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+23}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - \left(4 \cdot \left(3 - 2 \cdot x2\right) - x1 \cdot -3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.3 \cdot 10^{+24}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 + x1 \cdot \left(-1 - x1 \cdot \left(x2 \cdot -2 - \left(x1 + 3\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5e23Initial program 28.4%
Taylor expanded in x1 around -inf 43.2%
Taylor expanded in x1 around inf 96.3%
Taylor expanded in x1 around 0 77.2%
if -2.5e23 < x1 < 3.2999999999999999e24Initial program 99.4%
Taylor expanded in x1 around 0 81.9%
Taylor expanded in x1 around 0 81.6%
Taylor expanded in x1 around 0 82.2%
Taylor expanded in x2 around 0 94.6%
if 3.2999999999999999e24 < x1 Initial program 44.6%
Taylor expanded in x1 around 0 11.9%
Taylor expanded in x1 around 0 70.7%
Final simplification85.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0)))))
(t_1 (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))))
(if (<= x1 -8.6e+142)
t_0
(if (<= x1 -1.18e+39)
(+ 9.0 (* x1 (+ 2.0 (* x1 (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2))))))))
(if (<= x1 -3e-43)
t_1
(if (<= x1 7.5e-105)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.5e+153) t_1 t_0)))))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double t_1 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -8.6e+142) {
tmp = t_0;
} else if (x1 <= -1.18e+39) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= -3e-43) {
tmp = t_1;
} else if (x1 <= 7.5e-105) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} 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) :: tmp
t_0 = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
t_1 = x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
if (x1 <= (-8.6d+142)) then
tmp = t_0
else if (x1 <= (-1.18d+39)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))))))
else if (x1 <= (-3d-43)) then
tmp = t_1
else if (x1 <= 7.5d-105) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.5d+153) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double t_1 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double tmp;
if (x1 <= -8.6e+142) {
tmp = t_0;
} else if (x1 <= -1.18e+39) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= -3e-43) {
tmp = t_1;
} else if (x1 <= 7.5e-105) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) t_1 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) tmp = 0 if x1 <= -8.6e+142: tmp = t_0 elif x1 <= -1.18e+39: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))) elif x1 <= -3e-43: tmp = t_1 elif x1 <= 7.5e-105: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.5e+153: tmp = t_1 else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))) t_1 = Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) tmp = 0.0 if (x1 <= -8.6e+142) tmp = t_0; elseif (x1 <= -1.18e+39) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))))))); elseif (x1 <= -3e-43) tmp = t_1; elseif (x1 <= 7.5e-105) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); t_1 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); tmp = 0.0; if (x1 <= -8.6e+142) tmp = t_0; elseif (x1 <= -1.18e+39) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))); elseif (x1 <= -3e-43) tmp = t_1; elseif (x1 <= 7.5e-105) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.5e+153) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -8.6e+142], t$95$0, If[LessEqual[x1, -1.18e+39], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3e-43], t$95$1, If[LessEqual[x1, 7.5e-105], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
t_1 := x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -8.6 \cdot 10^{+142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -1.18 \cdot 10^{+39}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - 4 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 7.5 \cdot 10^{-105}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -8.60000000000000025e142 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.6%
Taylor expanded in x2 around 0 98.5%
if -8.60000000000000025e142 < x1 < -1.17999999999999996e39Initial program 57.6%
Taylor expanded in x1 around -inf 95.2%
Taylor expanded in x1 around inf 95.2%
Taylor expanded in x1 around 0 37.6%
if -1.17999999999999996e39 < x1 < -3.00000000000000003e-43 or 7.5000000000000006e-105 < x1 < 4.5000000000000001e153Initial program 99.3%
Taylor expanded in x1 around 0 56.0%
Taylor expanded in x1 around 0 55.7%
Taylor expanded in x1 around 0 55.4%
Taylor expanded in x1 around inf 49.5%
if -3.00000000000000003e-43 < x1 < 7.5000000000000006e-105Initial program 99.5%
Taylor expanded in x1 around 0 82.7%
Taylor expanded in x1 around 0 82.7%
Taylor expanded in x1 around 0 82.9%
Taylor expanded in x2 around 0 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification73.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))
(if (<= x1 -9e+142)
t_0
(if (<= x1 -4.6e+38)
(+ 9.0 (* x1 (+ 2.0 (* x1 (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2))))))))
(if (<= x1 4.5e+153)
(+
x1
(- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -9e+142) {
tmp = t_0;
} else if (x1 <= -4.6e+38) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} 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 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
if (x1 <= (-9d+142)) then
tmp = t_0
else if (x1 <= (-4.6d+38)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))))))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -9e+142) {
tmp = t_0;
} else if (x1 <= -4.6e+38) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) tmp = 0 if x1 <= -9e+142: tmp = t_0 elif x1 <= -4.6e+38: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))) elif x1 <= 4.5e+153: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))) tmp = 0.0 if (x1 <= -9e+142) tmp = t_0; elseif (x1 <= -4.6e+38) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))))))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); tmp = 0.0; if (x1 <= -9e+142) tmp = t_0; elseif (x1 <= -4.6e+38) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))); elseif (x1 <= 4.5e+153) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9e+142], t$95$0, If[LessEqual[x1, -4.6e+38], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -9 \cdot 10^{+142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -4.6 \cdot 10^{+38}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - 4 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -8.9999999999999998e142 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.6%
Taylor expanded in x2 around 0 98.5%
if -8.9999999999999998e142 < x1 < -4.6000000000000002e38Initial program 57.6%
Taylor expanded in x1 around -inf 95.2%
Taylor expanded in x1 around inf 95.2%
Taylor expanded in x1 around 0 37.6%
if -4.6000000000000002e38 < x1 < 4.5000000000000001e153Initial program 99.4%
Taylor expanded in x1 around 0 72.5%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x2 around 0 82.8%
Final simplification83.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ 2.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(t_1 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))
(if (<= x1 -5.8e+98)
t_1
(if (<= x1 -1.9e-29)
t_0
(if (<= x1 2.1e-44)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.5e+153) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -5.8e+98) {
tmp = t_1;
} else if (x1 <= -1.9e-29) {
tmp = t_0;
} else if (x1 <= 2.1e-44) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * (2.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
t_1 = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
if (x1 <= (-5.8d+98)) then
tmp = t_1
else if (x1 <= (-1.9d-29)) then
tmp = t_0
else if (x1 <= 2.1d-44) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -5.8e+98) {
tmp = t_1;
} else if (x1 <= -1.9e-29) {
tmp = t_0;
} else if (x1 <= 2.1e-44) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) tmp = 0 if x1 <= -5.8e+98: tmp = t_1 elif x1 <= -1.9e-29: tmp = t_0 elif x1 <= 2.1e-44: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.5e+153: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(2.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) t_1 = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))) tmp = 0.0 if (x1 <= -5.8e+98) tmp = t_1; elseif (x1 <= -1.9e-29) tmp = t_0; elseif (x1 <= 2.1e-44) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (2.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); tmp = 0.0; if (x1 <= -5.8e+98) tmp = t_1; elseif (x1 <= -1.9e-29) tmp = t_0; elseif (x1 <= 2.1e-44) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(2.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+98], t$95$1, If[LessEqual[x1, -1.9e-29], t$95$0, If[LessEqual[x1, 2.1e-44], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(2 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_1 := x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -1.9 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 2.1 \cdot 10^{-44}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -5.8000000000000002e98 or 4.5000000000000001e153 < x1 Initial program 1.5%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 62.3%
Taylor expanded in x2 around 0 86.3%
if -5.8000000000000002e98 < x1 < -1.89999999999999988e-29 or 2.10000000000000001e-44 < x1 < 4.5000000000000001e153Initial program 99.4%
Taylor expanded in x1 around 0 43.8%
Taylor expanded in x1 around inf 36.6%
Taylor expanded in x1 around inf 36.4%
if -1.89999999999999988e-29 < x1 < 2.10000000000000001e-44Initial program 99.5%
Taylor expanded in x1 around 0 84.2%
Taylor expanded in x1 around 0 84.2%
Taylor expanded in x1 around 0 84.5%
Taylor expanded in x2 around 0 78.8%
*-commutative78.8%
Simplified78.8%
Final simplification69.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
(t_1 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))
(if (<= x1 -5.8e+98)
t_1
(if (<= x1 -3e-43)
t_0
(if (<= x1 3.1e-102)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 4.5e+153) t_0 t_1))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -5.8e+98) {
tmp = t_1;
} else if (x1 <= -3e-43) {
tmp = t_0;
} else if (x1 <= 3.1e-102) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))))
t_1 = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
if (x1 <= (-5.8d+98)) then
tmp = t_1
else if (x1 <= (-3d-43)) then
tmp = t_0
else if (x1 <= 3.1d-102) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))));
double t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -5.8e+98) {
tmp = t_1;
} else if (x1 <= -3e-43) {
tmp = t_0;
} else if (x1 <= 3.1e-102) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))) t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) tmp = 0 if x1 <= -5.8e+98: tmp = t_1 elif x1 <= -3e-43: tmp = t_0 elif x1 <= 3.1e-102: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 4.5e+153: tmp = t_0 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))) t_1 = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))) tmp = 0.0 if (x1 <= -5.8e+98) tmp = t_1; elseif (x1 <= -3e-43) tmp = t_0; elseif (x1 <= 3.1e-102) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))); t_1 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); tmp = 0.0; if (x1 <= -5.8e+98) tmp = t_1; elseif (x1 <= -3e-43) tmp = t_0; elseif (x1 <= 3.1e-102) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+98], t$95$1, If[LessEqual[x1, -3e-43], t$95$0, If[LessEqual[x1, 3.1e-102], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
t_1 := x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -3 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 3.1 \cdot 10^{-102}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -5.8000000000000002e98 or 4.5000000000000001e153 < x1 Initial program 1.5%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 62.3%
Taylor expanded in x2 around 0 86.3%
if -5.8000000000000002e98 < x1 < -3.00000000000000003e-43 or 3.10000000000000013e-102 < x1 < 4.5000000000000001e153Initial program 99.3%
Taylor expanded in x1 around 0 51.5%
Taylor expanded in x1 around 0 51.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around inf 46.0%
if -3.00000000000000003e-43 < x1 < 3.10000000000000013e-102Initial program 99.5%
Taylor expanded in x1 around 0 82.7%
Taylor expanded in x1 around 0 82.7%
Taylor expanded in x1 around 0 82.9%
Taylor expanded in x2 around 0 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification71.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0))))))
(if (<= x1 -9e+142)
t_0
(if (<= x1 -4.6e+38)
(+ 9.0 (* x1 (+ 2.0 (* x1 (- 9.0 (* 4.0 (- 3.0 (* 2.0 x2))))))))
(if (<= x1 4.5e+153)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))
t_0)))))
double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -9e+142) {
tmp = t_0;
} else if (x1 <= -4.6e+38) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.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 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
if (x1 <= (-9d+142)) then
tmp = t_0
else if (x1 <= (-4.6d+38)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - (4.0d0 * (3.0d0 - (2.0d0 * x2)))))))
else if (x1 <= 4.5d+153) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
double tmp;
if (x1 <= -9e+142) {
tmp = t_0;
} else if (x1 <= -4.6e+38) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2)))))));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x1, x2): t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) tmp = 0 if x1 <= -9e+142: tmp = t_0 elif x1 <= -4.6e+38: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))) elif x1 <= 4.5e+153: tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = t_0 return tmp
function code(x1, x2) t_0 = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))) tmp = 0.0 if (x1 <= -9e+142) tmp = t_0; elseif (x1 <= -4.6e+38) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(4.0 * Float64(3.0 - Float64(2.0 * x2)))))))); elseif (x1 <= 4.5e+153) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); tmp = 0.0; if (x1 <= -9e+142) tmp = t_0; elseif (x1 <= -4.6e+38) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - (4.0 * (3.0 - (2.0 * x2))))))); elseif (x1 <= 4.5e+153) tmp = (x2 * -6.0) + (x1 * (-1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = t_0; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -9e+142], t$95$0, If[LessEqual[x1, -4.6e+38], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\mathbf{if}\;x1 \leq -9 \cdot 10^{+142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq -4.6 \cdot 10^{+38}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - 4 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x1 < -8.9999999999999998e142 or 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 69.6%
Taylor expanded in x2 around 0 98.5%
if -8.9999999999999998e142 < x1 < -4.6000000000000002e38Initial program 57.6%
Taylor expanded in x1 around -inf 95.2%
Taylor expanded in x1 around inf 95.2%
Taylor expanded in x1 around 0 37.6%
if -4.6000000000000002e38 < x1 < 4.5000000000000001e153Initial program 99.4%
Taylor expanded in x1 around 0 72.5%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x1 around 0 72.4%
Taylor expanded in x1 around 0 72.5%
Final simplification75.9%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.5e+23)
(+
9.0
(* x1 (+ 2.0 (* x1 (- 9.0 (- (* 4.0 (- 3.0 (* 2.0 x2))) (* x1 -3.0)))))))
(if (<= x1 4.5e+153)
(+ x1 (- (* x1 -2.0) (* x2 (- 6.0 (+ (* x1 -12.0) (* 8.0 (* x1 x2)))))))
(+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.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.5d+23)) then
tmp = 9.0d0 + (x1 * (2.0d0 + (x1 * (9.0d0 - ((4.0d0 * (3.0d0 - (2.0d0 * x2))) - (x1 * (-3.0d0)))))))
else if (x1 <= 4.5d+153) then
tmp = x1 + ((x1 * (-2.0d0)) - (x2 * (6.0d0 - ((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))))))
else
tmp = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.5e+23) {
tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0))))));
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2))))));
} else {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.5e+23: tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))) elif x1 <= 4.5e+153: tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))) else: tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.5e+23) tmp = Float64(9.0 + Float64(x1 * Float64(2.0 + Float64(x1 * Float64(9.0 - Float64(Float64(4.0 * Float64(3.0 - Float64(2.0 * x2))) - Float64(x1 * -3.0))))))); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) - Float64(x2 * Float64(6.0 - Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))))))); else tmp = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.5e+23) tmp = 9.0 + (x1 * (2.0 + (x1 * (9.0 - ((4.0 * (3.0 - (2.0 * x2))) - (x1 * -3.0)))))); elseif (x1 <= 4.5e+153) tmp = x1 + ((x1 * -2.0) - (x2 * (6.0 - ((x1 * -12.0) + (8.0 * (x1 * x2)))))); else tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.5e+23], N[(9.0 + N[(x1 * N[(2.0 + N[(x1 * N[(9.0 - N[(N[(4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] - N[(x2 * N[(6.0 - N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.5 \cdot 10^{+23}:\\
\;\;\;\;9 + x1 \cdot \left(2 + x1 \cdot \left(9 - \left(4 \cdot \left(3 - 2 \cdot x2\right) - x1 \cdot -3\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 - x2 \cdot \left(6 - \left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\end{array}
\end{array}
if x1 < -2.5e23Initial program 28.4%
Taylor expanded in x1 around -inf 43.2%
Taylor expanded in x1 around inf 96.3%
Taylor expanded in x1 around 0 77.2%
if -2.5e23 < x1 < 4.5000000000000001e153Initial program 99.5%
Taylor expanded in x1 around 0 73.7%
Taylor expanded in x1 around 0 73.5%
Taylor expanded in x1 around 0 73.6%
Taylor expanded in x2 around 0 84.2%
if 4.5000000000000001e153 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 75.0%
Taylor expanded in x2 around 0 100.0%
Final simplification84.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.15e-10) (not (<= x1 1.95e-16))) (+ x1 (+ x1 (* x1 (- (* x1 9.0) 3.0)))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.15e-10) || !(x1 <= 1.95e-16)) {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.15d-10)) .or. (.not. (x1 <= 1.95d-16))) then
tmp = x1 + (x1 + (x1 * ((x1 * 9.0d0) - 3.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.15e-10) || !(x1 <= 1.95e-16)) {
tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.15e-10) or not (x1 <= 1.95e-16): tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.15e-10) || !(x1 <= 1.95e-16)) tmp = Float64(x1 + Float64(x1 + Float64(x1 * Float64(Float64(x1 * 9.0) - 3.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.15e-10) || ~((x1 <= 1.95e-16))) tmp = x1 + (x1 + (x1 * ((x1 * 9.0) - 3.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.15e-10], N[Not[LessEqual[x1, 1.95e-16]], $MachinePrecision]], N[(x1 + N[(x1 + N[(x1 * N[(N[(x1 * 9.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.15 \cdot 10^{-10} \lor \neg \left(x1 \leq 1.95 \cdot 10^{-16}\right):\\
\;\;\;\;x1 + \left(x1 + x1 \cdot \left(x1 \cdot 9 - 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -1.15000000000000004e-10 or 1.94999999999999989e-16 < x1 Initial program 45.2%
Taylor expanded in x1 around 0 14.1%
Taylor expanded in x1 around 0 48.4%
Taylor expanded in x2 around 0 51.1%
if -1.15000000000000004e-10 < x1 < 1.94999999999999989e-16Initial program 99.5%
Taylor expanded in x1 around 0 85.6%
Taylor expanded in x1 around 0 85.6%
Taylor expanded in x1 around 0 85.6%
Taylor expanded in x2 around 0 74.7%
*-commutative74.7%
Simplified74.7%
Final simplification63.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -2.5e-215) (not (<= x2 5.2e-177))) (+ x1 (* x2 -6.0)) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.5e-215) || !(x2 <= 5.2e-177)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-2.5d-215)) .or. (.not. (x2 <= 5.2d-177))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -2.5e-215) || !(x2 <= 5.2e-177)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -2.5e-215) or not (x2 <= 5.2e-177): tmp = x1 + (x2 * -6.0) else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -2.5e-215) || !(x2 <= 5.2e-177)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -2.5e-215) || ~((x2 <= 5.2e-177))) tmp = x1 + (x2 * -6.0); else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -2.5e-215], N[Not[LessEqual[x2, 5.2e-177]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -2.5 \cdot 10^{-215} \lor \neg \left(x2 \leq 5.2 \cdot 10^{-177}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -2.49999999999999978e-215 or 5.2000000000000002e-177 < x2 Initial program 72.6%
Taylor expanded in x1 around 0 49.2%
Taylor expanded in x1 around 0 65.7%
Taylor expanded in x1 around 0 33.1%
*-commutative33.1%
Simplified33.1%
if -2.49999999999999978e-215 < x2 < 5.2000000000000002e-177Initial program 77.9%
Taylor expanded in x1 around 0 62.6%
Taylor expanded in x1 around 0 79.4%
Taylor expanded in x1 around 0 64.2%
Taylor expanded in x2 around 0 51.4%
distribute-rgt1-in51.4%
metadata-eval51.4%
neg-mul-151.4%
Simplified51.4%
Final simplification35.8%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x2 -6.0) (* x1 -2.0))))
double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
def code(x1, x2): return x1 + ((x2 * -6.0) + (x1 * -2.0))
function code(x1, x2) return Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))) end
function tmp = code(x1, x2) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end
code[x1_, x2_] := N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)
\end{array}
Initial program 73.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 67.7%
Taylor expanded in x1 around 0 58.0%
Taylor expanded in x2 around 0 40.6%
*-commutative40.6%
Simplified40.6%
Final simplification40.6%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 73.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 67.7%
Taylor expanded in x1 around 0 58.0%
Taylor expanded in x2 around 0 11.8%
distribute-rgt1-in11.8%
metadata-eval11.8%
neg-mul-111.8%
Simplified11.8%
Final simplification11.8%
(FPCore (x1 x2) :precision binary64 9.0)
double code(double x1, double x2) {
return 9.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = 9.0d0
end function
public static double code(double x1, double x2) {
return 9.0;
}
def code(x1, x2): return 9.0
function code(x1, x2) return 9.0 end
function tmp = code(x1, x2) tmp = 9.0; end
code[x1_, x2_] := 9.0
\begin{array}{l}
\\
9
\end{array}
Initial program 73.4%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around inf 22.8%
Taylor expanded in x1 around 0 3.3%
Final simplification3.3%
herbie shell --seed 2024075
(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))))))