
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (/ (- (fma x1 (* x1 3.0) (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4 (* 3.0 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))
(* t_1 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_0 4.0 -6.0)) (* (* x1 (* 2.0 t_0)) (+ t_0 -3.0)))
(fma t_4 t_0 (pow x1 3.0))))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = (fma(x1, (x1 * 3.0), (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = 3.0 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)))) + (t_1 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_0, 4.0, -6.0)), ((x1 * (2.0 * t_0)) * (t_0 + -3.0))), fma(t_4, t_0, pow(x1, 3.0)))));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(Float64(fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(3.0 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) + Float64(t_1 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_0, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_0)) * Float64(t_0 + -3.0))), fma(t_4, t_0, (x1 ^ 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$0 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$0 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right) + t\_1 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_0, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_0\right)\right) \cdot \left(t\_0 + -3\right)\right), \mathsf{fma}\left(t\_4, t\_0, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Simplified99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(*
t_2
(+
(* (* (* x1 2.0) t_3) (- t_3 3.0))
(* (* x1 x1) (- (* t_3 4.0) 6.0))))))
(if (<=
(+
x1
(+
(+ x1 (+ (+ t_4 (* t_1 t_3)) t_0))
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+ x1 (+ (+ x1 (+ t_0 (+ t_4 (* 3.0 t_1)))) (* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (+ (+ x1 (* 6.0 (pow x1 4.0))) (* 3.0 (* x2 -2.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 + (6.0 * pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0)));
double tmp;
if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Double.POSITIVE_INFINITY) {
tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + ((x1 + (6.0 * Math.pow(x1, 4.0))) + (3.0 * (x2 * -2.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))) tmp = 0 if (x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= math.inf: tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + ((x1 + (6.0 * math.pow(x1, 4.0))) + (3.0 * (x2 * -2.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(t_2 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_3) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)))) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(t_4 + Float64(t_1 * t_3)) + t_0)) + Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(x1 + Float64(t_0 + Float64(t_4 + Float64(3.0 * t_1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(6.0 * (x1 ^ 4.0))) + Float64(3.0 * Float64(x2 * -2.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = t_2 * ((((x1 * 2.0) * t_3) * (t_3 - 3.0)) + ((x1 * x1) * ((t_3 * 4.0) - 6.0))); tmp = 0.0; if ((x1 + ((x1 + ((t_4 + (t_1 * t_3)) + t_0)) + (3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = x1 + ((x1 + (t_0 + (t_4 + (3.0 * t_1)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + ((x1 + (6.0 * (x1 ^ 4.0))) + (3.0 * (x2 * -2.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(t$95$4 + N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(x1 + N[(t$95$0 + N[(t$95$4 + N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := t\_2 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_3\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right)\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_4 + t\_1 \cdot t\_3\right) + t\_0\right)\right) + 3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(x1 + \left(t\_0 + \left(t\_4 + 3 \cdot t\_1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 6 \cdot {x1}^{4}\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.4%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
Taylor expanded in x1 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))))
(t_2 (* x2 (- (* 2.0 x2) 3.0)))
(t_3 (* 4.0 t_2))
(t_4 (* x1 (* x1 3.0)))
(t_5 (/ (- (+ t_4 (* 2.0 x2)) x1) t_0))
(t_6
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_4)
(*
t_0
(+
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(* (- t_5 3.0) (* (* x1 2.0) 3.0)))))))))))
(if (<= x1 -5.8e+103)
t_1
(if (<= x1 -6400.0)
t_6
(if (<= x1 -5.4e-182)
(+
x1
(+
(* 3.0 (/ (- (- t_4 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_2)))))
(if (<= x1 9.5e-217)
t_1
(if (<= x1 46000.0)
(+ (* x1 (+ t_3 -1.0)) (* x2 -6.0))
(if (<= x1 1.35e+154) t_6 (+ x1 (* x1 (+ 1.0 t_3)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_0;
double t_6 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * 3.0))))))));
double tmp;
if (x1 <= -5.8e+103) {
tmp = t_1;
} else if (x1 <= -6400.0) {
tmp = t_6;
} else if (x1 <= -5.4e-182) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_2))));
} else if (x1 <= 9.5e-217) {
tmp = t_1;
} else if (x1 <= 46000.0) {
tmp = (x1 * (t_3 + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 + t_3));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
t_2 = x2 * ((2.0d0 * x2) - 3.0d0)
t_3 = 4.0d0 * t_2
t_4 = x1 * (x1 * 3.0d0)
t_5 = ((t_4 + (2.0d0 * x2)) - x1) / t_0
t_6 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_4) + (t_0 * (((x1 * x1) * ((t_5 * 4.0d0) - 6.0d0)) + ((t_5 - 3.0d0) * ((x1 * 2.0d0) * 3.0d0))))))))
if (x1 <= (-5.8d+103)) then
tmp = t_1
else if (x1 <= (-6400.0d0)) then
tmp = t_6
else if (x1 <= (-5.4d-182)) then
tmp = x1 + ((3.0d0 * (((t_4 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_2))))
else if (x1 <= 9.5d-217) then
tmp = t_1
else if (x1 <= 46000.0d0) then
tmp = (x1 * (t_3 + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= 1.35d+154) then
tmp = t_6
else
tmp = x1 + (x1 * (1.0d0 + t_3))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
double t_2 = x2 * ((2.0 * x2) - 3.0);
double t_3 = 4.0 * t_2;
double t_4 = x1 * (x1 * 3.0);
double t_5 = ((t_4 + (2.0 * x2)) - x1) / t_0;
double t_6 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * 3.0))))))));
double tmp;
if (x1 <= -5.8e+103) {
tmp = t_1;
} else if (x1 <= -6400.0) {
tmp = t_6;
} else if (x1 <= -5.4e-182) {
tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_2))));
} else if (x1 <= 9.5e-217) {
tmp = t_1;
} else if (x1 <= 46000.0) {
tmp = (x1 * (t_3 + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = t_6;
} else {
tmp = x1 + (x1 * (1.0 + t_3));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) t_2 = x2 * ((2.0 * x2) - 3.0) t_3 = 4.0 * t_2 t_4 = x1 * (x1 * 3.0) t_5 = ((t_4 + (2.0 * x2)) - x1) / t_0 t_6 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * 3.0)))))))) tmp = 0 if x1 <= -5.8e+103: tmp = t_1 elif x1 <= -6400.0: tmp = t_6 elif x1 <= -5.4e-182: tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_2)))) elif x1 <= 9.5e-217: tmp = t_1 elif x1 <= 46000.0: tmp = (x1 * (t_3 + -1.0)) + (x2 * -6.0) elif x1 <= 1.35e+154: tmp = t_6 else: tmp = x1 + (x1 * (1.0 + t_3)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))) t_2 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_3 = Float64(4.0 * t_2) t_4 = Float64(x1 * Float64(x1 * 3.0)) t_5 = Float64(Float64(Float64(t_4 + Float64(2.0 * x2)) - x1) / t_0) t_6 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_4) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) + Float64(Float64(t_5 - 3.0) * Float64(Float64(x1 * 2.0) * 3.0))))))))) tmp = 0.0 if (x1 <= -5.8e+103) tmp = t_1; elseif (x1 <= -6400.0) tmp = t_6; elseif (x1 <= -5.4e-182) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_4 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_2))))); elseif (x1 <= 9.5e-217) tmp = t_1; elseif (x1 <= 46000.0) tmp = Float64(Float64(x1 * Float64(t_3 + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_3))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); t_2 = x2 * ((2.0 * x2) - 3.0); t_3 = 4.0 * t_2; t_4 = x1 * (x1 * 3.0); t_5 = ((t_4 + (2.0 * x2)) - x1) / t_0; t_6 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_4) + (t_0 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) + ((t_5 - 3.0) * ((x1 * 2.0) * 3.0)))))))); tmp = 0.0; if (x1 <= -5.8e+103) tmp = t_1; elseif (x1 <= -6400.0) tmp = t_6; elseif (x1 <= -5.4e-182) tmp = x1 + ((3.0 * (((t_4 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_2)))); elseif (x1 <= 9.5e-217) tmp = t_1; elseif (x1 <= 46000.0) tmp = (x1 * (t_3 + -1.0)) + (x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_6; else tmp = x1 + (x1 * (1.0 + t_3)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$4), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 - 3.0), $MachinePrecision] * N[(N[(x1 * 2.0), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+103], t$95$1, If[LessEqual[x1, -6400.0], t$95$6, If[LessEqual[x1, -5.4e-182], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$4 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 9.5e-217], t$95$1, If[LessEqual[x1, 46000.0], N[(N[(x1 * N[(t$95$3 + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$6, N[(x1 + N[(x1 * N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
t_2 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_3 := 4 \cdot t\_2\\
t_4 := x1 \cdot \left(x1 \cdot 3\right)\\
t_5 := \frac{\left(t\_4 + 2 \cdot x2\right) - x1}{t\_0}\\
t_6 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_4 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) + \left(t\_5 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot 3\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -6400:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;x1 \leq -5.4 \cdot 10^{-182}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_4 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_2\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 9.5 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 46000:\\
\;\;\;\;x1 \cdot \left(t\_3 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_3\right)\\
\end{array}
\end{array}
if x1 < -5.7999999999999997e103 or -5.39999999999999999e-182 < x1 < 9.5000000000000001e-217Initial program 61.6%
Taylor expanded in x1 around 0 50.3%
Taylor expanded in x1 around 0 51.4%
fma-define51.5%
fma-neg51.5%
fma-neg51.5%
metadata-eval51.5%
metadata-eval51.5%
Simplified51.5%
Taylor expanded in x2 around 0 67.7%
if -5.7999999999999997e103 < x1 < -6400 or 46000 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 99.4%
Taylor expanded in x1 around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around inf 86.3%
if -6400 < x1 < -5.39999999999999999e-182Initial program 99.2%
Taylor expanded in x1 around 0 93.9%
if 9.5000000000000001e-217 < x1 < 46000Initial program 99.4%
Taylor expanded in x1 around 0 92.4%
Taylor expanded in x1 around 0 92.5%
fma-define92.6%
fma-neg92.6%
fma-neg92.6%
metadata-eval92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in x1 around 0 92.5%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 49.5%
Final simplification77.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.8e+103)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* 3.0 t_0))))
(* 3.0 (- (* x2 -2.0) x1))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.8d+103)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (3.0d0 * t_0)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1)));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.8e+103: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.8e+103) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.8e+103) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (3.0 * t_0)))) + (3.0 * ((x2 * -2.0) - x1))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.8e+103], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.7999999999999997e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.7%
fma-define2.7%
fma-neg2.7%
fma-neg2.7%
metadata-eval2.7%
metadata-eval2.7%
Simplified2.7%
Taylor expanded in x2 around 0 25.0%
if -5.7999999999999997e103 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 49.5%
Final simplification84.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x2 (- (* 2.0 x2) 3.0)))
(t_2 (* 4.0 t_1))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_0))
(t_5
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_3)
(*
t_0
(+ (* (* (* x1 2.0) t_4) (- t_4 3.0)) (* (* x1 x1) 6.0))))))))))
(if (<= x1 -5.8e+103)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 -4800.0)
t_5
(if (<= x1 -4.8e-228)
(+
x1
(+
(* 3.0 (/ (- (- t_3 (* 2.0 x2)) x1) t_0))
(+ x1 (* 4.0 (* x1 t_1)))))
(if (<= x1 3.7e-180)
t_5
(if (<= x1 6.4e-9)
(+ (* x1 (+ t_2 -1.0)) (* x2 -6.0))
(if (<= x1 1.35e+154) t_5 (+ x1 (* x1 (+ 1.0 t_2)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = 4.0 * t_1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4800.0) {
tmp = t_5;
} else if (x1 <= -4.8e-228) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 3.7e-180) {
tmp = t_5;
} else if (x1 <= 6.4e-9) {
tmp = (x1 * (t_2 + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + 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) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x2 * ((2.0d0 * x2) - 3.0d0)
t_2 = 4.0d0 * t_1
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_0
t_5 = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_3) + (t_0 * ((((x1 * 2.0d0) * t_4) * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
if (x1 <= (-5.8d+103)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= (-4800.0d0)) then
tmp = t_5
else if (x1 <= (-4.8d-228)) then
tmp = x1 + ((3.0d0 * (((t_3 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + (4.0d0 * (x1 * t_1))))
else if (x1 <= 3.7d-180) then
tmp = t_5
else if (x1 <= 6.4d-9) then
tmp = (x1 * (t_2 + (-1.0d0))) + (x2 * (-6.0d0))
else if (x1 <= 1.35d+154) then
tmp = t_5
else
tmp = x1 + (x1 * (1.0d0 + t_2))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x2 * ((2.0 * x2) - 3.0);
double t_2 = 4.0 * t_1;
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0;
double t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= -4800.0) {
tmp = t_5;
} else if (x1 <= -4.8e-228) {
tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1))));
} else if (x1 <= 3.7e-180) {
tmp = t_5;
} else if (x1 <= 6.4e-9) {
tmp = (x1 * (t_2 + -1.0)) + (x2 * -6.0);
} else if (x1 <= 1.35e+154) {
tmp = t_5;
} else {
tmp = x1 + (x1 * (1.0 + t_2));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x2 * ((2.0 * x2) - 3.0) t_2 = 4.0 * t_1 t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0 t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))) tmp = 0 if x1 <= -5.8e+103: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= -4800.0: tmp = t_5 elif x1 <= -4.8e-228: tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))) elif x1 <= 3.7e-180: tmp = t_5 elif x1 <= 6.4e-9: tmp = (x1 * (t_2 + -1.0)) + (x2 * -6.0) elif x1 <= 1.35e+154: tmp = t_5 else: tmp = x1 + (x1 * (1.0 + t_2)) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_2 = Float64(4.0 * t_1) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_0) t_5 = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_3) + Float64(t_0 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_4) * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))) tmp = 0.0 if (x1 <= -5.8e+103) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= -4800.0) tmp = t_5; elseif (x1 <= -4.8e-228) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_3 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_1))))); elseif (x1 <= 3.7e-180) tmp = t_5; elseif (x1 <= 6.4e-9) tmp = Float64(Float64(x1 * Float64(t_2 + -1.0)) + Float64(x2 * -6.0)); elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_2))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x2 * ((2.0 * x2) - 3.0); t_2 = 4.0 * t_1; t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_0; t_5 = x1 + ((3.0 * (x2 * -2.0)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_3) + (t_0 * ((((x1 * 2.0) * t_4) * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))); tmp = 0.0; if (x1 <= -5.8e+103) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= -4800.0) tmp = t_5; elseif (x1 <= -4.8e-228) tmp = x1 + ((3.0 * (((t_3 - (2.0 * x2)) - x1) / t_0)) + (x1 + (4.0 * (x1 * t_1)))); elseif (x1 <= 3.7e-180) tmp = t_5; elseif (x1 <= 6.4e-9) tmp = (x1 * (t_2 + -1.0)) + (x2 * -6.0); elseif (x1 <= 1.35e+154) tmp = t_5; else tmp = x1 + (x1 * (1.0 + t_2)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+103], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4800.0], t$95$5, If[LessEqual[x1, -4.8e-228], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$3 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3.7e-180], t$95$5, If[LessEqual[x1, 6.4e-9], N[(N[(x1 * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$5, N[(x1 + N[(x1 * N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_2 := 4 \cdot t\_1\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_0}\\
t_5 := x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_3 + t\_0 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_4\right) \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq -4800:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq -4.8 \cdot 10^{-228}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_3 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + 4 \cdot \left(x1 \cdot t\_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 3.7 \cdot 10^{-180}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 6.4 \cdot 10^{-9}:\\
\;\;\;\;x1 \cdot \left(t\_2 + -1\right) + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_2\right)\\
\end{array}
\end{array}
if x1 < -5.7999999999999997e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.7%
fma-define2.7%
fma-neg2.7%
fma-neg2.7%
metadata-eval2.7%
metadata-eval2.7%
Simplified2.7%
Taylor expanded in x2 around 0 25.0%
if -5.7999999999999997e103 < x1 < -4800 or -4.80000000000000004e-228 < x1 < 3.70000000000000016e-180 or 6.40000000000000023e-9 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around inf 99.1%
Taylor expanded in x1 around 0 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x1 around inf 92.3%
if -4800 < x1 < -4.80000000000000004e-228Initial program 99.3%
Taylor expanded in x1 around 0 93.4%
if 3.70000000000000016e-180 < x1 < 6.40000000000000023e-9Initial program 99.2%
Taylor expanded in x1 around 0 94.3%
Taylor expanded in x1 around 0 94.7%
fma-define94.8%
fma-neg94.8%
fma-neg94.8%
metadata-eval94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in x1 around 0 94.7%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 49.5%
Final simplification79.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (<= x1 -5.8e+103)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* 3.0 t_0)
(*
t_1
(+ (* (* (* x1 2.0) t_2) (- t_2 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if (x1 <= (-5.8d+103)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if x1 <= -5.8e+103: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if (x1 <= -5.8e+103) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 1.35e+154) 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(3.0 * t_0) + Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if (x1 <= -5.8e+103) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -5.8e+103], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], 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[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;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(3 \cdot t\_0 + t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.7999999999999997e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.7%
fma-define2.7%
fma-neg2.7%
fma-neg2.7%
metadata-eval2.7%
metadata-eval2.7%
Simplified2.7%
Taylor expanded in x2 around 0 25.0%
if -5.7999999999999997e103 < x1 < 1.35000000000000003e154Initial program 99.4%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around inf 95.8%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 49.5%
Final simplification81.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (- (* 2.0 x2) 3.0))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* x1 (* x1 x1)))
(t_3 (* x1 (* x1 3.0)))
(t_4 (/ (- (+ t_3 (* 2.0 x2)) x1) t_1))
(t_5 (* 3.0 t_3))
(t_6 (* (* x1 2.0) t_4)))
(if (<= x1 -5.8e+103)
(+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))
(if (<= x1 2.6e-15)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
t_2
(+
t_5
(* t_1 (+ (* (* x1 x1) (- (* t_4 4.0) 6.0)) (* t_6 t_0))))))))
(if (<= x1 1.35e+154)
(+
x1
(+
(* 3.0 (* x2 -2.0))
(+
x1
(+
t_2
(+ t_5 (* t_1 (+ (* t_6 (- t_4 3.0)) (* (* x1 x1) 6.0))))))))
(+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 t_0))))))))))
double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_5 = 3.0 * t_3;
double t_6 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 2.6e-15) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_2 + (t_5 + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_6 * t_0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_2 + (t_5 + (t_1 * ((t_6 * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = (2.0d0 * x2) - 3.0d0
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 * (x1 * x1)
t_3 = x1 * (x1 * 3.0d0)
t_4 = ((t_3 + (2.0d0 * x2)) - x1) / t_1
t_5 = 3.0d0 * t_3
t_6 = (x1 * 2.0d0) * t_4
if (x1 <= (-5.8d+103)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else if (x1 <= 2.6d-15) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + (t_2 + (t_5 + (t_1 * (((x1 * x1) * ((t_4 * 4.0d0) - 6.0d0)) + (t_6 * t_0)))))))
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * (x2 * (-2.0d0))) + (x1 + (t_2 + (t_5 + (t_1 * ((t_6 * (t_4 - 3.0d0)) + ((x1 * x1) * 6.0d0)))))))
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * t_0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (2.0 * x2) - 3.0;
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 * (x1 * x1);
double t_3 = x1 * (x1 * 3.0);
double t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1;
double t_5 = 3.0 * t_3;
double t_6 = (x1 * 2.0) * t_4;
double tmp;
if (x1 <= -5.8e+103) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else if (x1 <= 2.6e-15) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_2 + (t_5 + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_6 * t_0)))))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_2 + (t_5 + (t_1 * ((t_6 * (t_4 - 3.0)) + ((x1 * x1) * 6.0)))))));
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0))));
}
return tmp;
}
def code(x1, x2): t_0 = (2.0 * x2) - 3.0 t_1 = (x1 * x1) + 1.0 t_2 = x1 * (x1 * x1) t_3 = x1 * (x1 * 3.0) t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1 t_5 = 3.0 * t_3 t_6 = (x1 * 2.0) * t_4 tmp = 0 if x1 <= -5.8e+103: tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) elif x1 <= 2.6e-15: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_2 + (t_5 + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_6 * t_0))))))) elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_2 + (t_5 + (t_1 * ((t_6 * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))) else: tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0)))) return tmp
function code(x1, x2) t_0 = Float64(Float64(2.0 * x2) - 3.0) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 * Float64(x1 * x1)) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) / t_1) t_5 = Float64(3.0 * t_3) t_6 = Float64(Float64(x1 * 2.0) * t_4) tmp = 0.0 if (x1 <= -5.8e+103) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); elseif (x1 <= 2.6e-15) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_4 * 4.0) - 6.0)) + Float64(t_6 * t_0)))))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(x2 * -2.0)) + Float64(x1 + Float64(t_2 + Float64(t_5 + Float64(t_1 * Float64(Float64(t_6 * Float64(t_4 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)))))))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * t_0))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (2.0 * x2) - 3.0; t_1 = (x1 * x1) + 1.0; t_2 = x1 * (x1 * x1); t_3 = x1 * (x1 * 3.0); t_4 = ((t_3 + (2.0 * x2)) - x1) / t_1; t_5 = 3.0 * t_3; t_6 = (x1 * 2.0) * t_4; tmp = 0.0; if (x1 <= -5.8e+103) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); elseif (x1 <= 2.6e-15) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + (t_2 + (t_5 + (t_1 * (((x1 * x1) * ((t_4 * 4.0) - 6.0)) + (t_6 * t_0))))))); elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * (x2 * -2.0)) + (x1 + (t_2 + (t_5 + (t_1 * ((t_6 * (t_4 - 3.0)) + ((x1 * x1) * 6.0))))))); else tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * t_0)))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(3.0 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * 2.0), $MachinePrecision] * t$95$4), $MachinePrecision]}, If[LessEqual[x1, -5.8e+103], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2.6e-15], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$4 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$2 + N[(t$95$5 + N[(t$95$1 * N[(N[(t$95$6 * N[(t$95$4 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot x2 - 3\\
t_1 := x1 \cdot x1 + 1\\
t_2 := x1 \cdot \left(x1 \cdot x1\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \frac{\left(t\_3 + 2 \cdot x2\right) - x1}{t\_1}\\
t_5 := 3 \cdot t\_3\\
t_6 := \left(x1 \cdot 2\right) \cdot t\_4\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{elif}\;x1 \leq 2.6 \cdot 10^{-15}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(t\_2 + \left(t\_5 + t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_4 \cdot 4 - 6\right) + t\_6 \cdot t\_0\right)\right)\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2\right) + \left(x1 + \left(t\_2 + \left(t\_5 + t\_1 \cdot \left(t\_6 \cdot \left(t\_4 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if x1 < -5.7999999999999997e103Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around 0 2.7%
fma-define2.7%
fma-neg2.7%
fma-neg2.7%
metadata-eval2.7%
metadata-eval2.7%
Simplified2.7%
Taylor expanded in x2 around 0 25.0%
if -5.7999999999999997e103 < x1 < 2.60000000000000004e-15Initial program 99.4%
Taylor expanded in x1 around inf 98.5%
Taylor expanded in x1 around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x1 around 0 95.8%
if 2.60000000000000004e-15 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around inf 98.4%
Taylor expanded in x1 around 0 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in x1 around inf 90.1%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 49.5%
Final simplification80.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.45e+109) (and (not (<= x1 -3.2e-261)) (<= x1 4e-217))) (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))) (+ (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)) (* x2 -6.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.45e+109) || (!(x1 <= -3.2e-261) && (x1 <= 4e-217))) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.45d+109)) .or. (.not. (x1 <= (-3.2d-261))) .and. (x1 <= 4d-217)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else
tmp = (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))) + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.45e+109) || (!(x1 <= -3.2e-261) && (x1 <= 4e-217))) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.45e+109) or (not (x1 <= -3.2e-261) and (x1 <= 4e-217)): tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) else: tmp = (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.45e+109) || (!(x1 <= -3.2e-261) && (x1 <= 4e-217))) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); else tmp = Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)) + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.45e+109) || (~((x1 <= -3.2e-261)) && (x1 <= 4e-217))) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); else tmp = (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0)) + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.45e+109], And[N[Not[LessEqual[x1, -3.2e-261]], $MachinePrecision], LessEqual[x1, 4e-217]]], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+109} \lor \neg \left(x1 \leq -3.2 \cdot 10^{-261}\right) \land x1 \leq 4 \cdot 10^{-217}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right) + x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.45e109 or -3.20000000000000004e-261 < x1 < 4.00000000000000033e-217Initial program 51.4%
Taylor expanded in x1 around 0 39.2%
Taylor expanded in x1 around 0 40.4%
fma-define40.5%
fma-neg40.5%
fma-neg40.5%
metadata-eval40.5%
metadata-eval40.5%
Simplified40.5%
Taylor expanded in x2 around 0 62.5%
if -1.45e109 < x1 < -3.20000000000000004e-261 or 4.00000000000000033e-217 < x1 Initial program 82.5%
Taylor expanded in x1 around 0 55.8%
Taylor expanded in x1 around 0 62.9%
fma-define62.9%
fma-neg62.9%
fma-neg62.9%
metadata-eval62.9%
metadata-eval62.9%
Simplified62.9%
Taylor expanded in x1 around 0 62.9%
Final simplification62.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))
(t_1 (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0))))))
(if (<= x1 -1.45e+109)
t_1
(if (<= x1 -3.8e-105)
(* x1 (+ t_0 -1.0))
(if (<= x1 3e-72) t_1 (+ x1 (* x1 (+ 1.0 t_0))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
double tmp;
if (x1 <= -1.45e+109) {
tmp = t_1;
} else if (x1 <= -3.8e-105) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 3e-72) {
tmp = t_1;
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
t_1 = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
if (x1 <= (-1.45d+109)) then
tmp = t_1
else if (x1 <= (-3.8d-105)) then
tmp = x1 * (t_0 + (-1.0d0))
else if (x1 <= 3d-72) then
tmp = t_1
else
tmp = x1 + (x1 * (1.0d0 + t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
double tmp;
if (x1 <= -1.45e+109) {
tmp = t_1;
} else if (x1 <= -3.8e-105) {
tmp = x1 * (t_0 + -1.0);
} else if (x1 <= 3e-72) {
tmp = t_1;
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) tmp = 0 if x1 <= -1.45e+109: tmp = t_1 elif x1 <= -3.8e-105: tmp = x1 * (t_0 + -1.0) elif x1 <= 3e-72: tmp = t_1 else: tmp = x1 + (x1 * (1.0 + t_0)) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) t_1 = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))) tmp = 0.0 if (x1 <= -1.45e+109) tmp = t_1; elseif (x1 <= -3.8e-105) tmp = Float64(x1 * Float64(t_0 + -1.0)); elseif (x1 <= 3e-72) tmp = t_1; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); t_1 = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); tmp = 0.0; if (x1 <= -1.45e+109) tmp = t_1; elseif (x1 <= -3.8e-105) tmp = x1 * (t_0 + -1.0); elseif (x1 <= 3e-72) tmp = t_1; else tmp = x1 + (x1 * (1.0 + t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -1.45e+109], t$95$1, If[LessEqual[x1, -3.8e-105], N[(x1 * N[(t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 3e-72], t$95$1, N[(x1 + N[(x1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
t_1 := x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -3.8 \cdot 10^{-105}:\\
\;\;\;\;x1 \cdot \left(t\_0 + -1\right)\\
\mathbf{elif}\;x1 \leq 3 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_0\right)\\
\end{array}
\end{array}
if x1 < -1.45e109 or -3.7999999999999998e-105 < x1 < 3e-72Initial program 76.5%
Taylor expanded in x1 around 0 66.3%
Taylor expanded in x1 around 0 67.2%
fma-define67.3%
fma-neg67.3%
fma-neg67.3%
metadata-eval67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in x2 around 0 71.2%
if -1.45e109 < x1 < -3.7999999999999998e-105Initial program 94.8%
Taylor expanded in x1 around 0 54.5%
Taylor expanded in x1 around 0 54.9%
fma-define54.9%
fma-neg54.9%
fma-neg54.9%
metadata-eval54.9%
metadata-eval54.9%
Simplified54.9%
Taylor expanded in x1 around inf 50.3%
if 3e-72 < x1 Initial program 62.3%
Taylor expanded in x1 around 0 27.6%
Taylor expanded in x1 around inf 42.6%
Final simplification58.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.45e+109) (and (not (<= x1 -5e-105)) (<= x1 4.1e-94))) (+ x1 (+ (* x1 -2.0) (* x2 (- (* x1 -12.0) 6.0)))) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.45e+109) || (!(x1 <= -5e-105) && (x1 <= 4.1e-94))) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.45d+109)) .or. (.not. (x1 <= (-5d-105))) .and. (x1 <= 4.1d-94)) then
tmp = x1 + ((x1 * (-2.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0)))
else
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.45e+109) || (!(x1 <= -5e-105) && (x1 <= 4.1e-94))) {
tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0)));
} else {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.45e+109) or (not (x1 <= -5e-105) and (x1 <= 4.1e-94)): tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))) else: tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.45e+109) || (!(x1 <= -5e-105) && (x1 <= 4.1e-94))) tmp = Float64(x1 + Float64(Float64(x1 * -2.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)))); else tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.45e+109) || (~((x1 <= -5e-105)) && (x1 <= 4.1e-94))) tmp = x1 + ((x1 * -2.0) + (x2 * ((x1 * -12.0) - 6.0))); else tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.45e+109], And[N[Not[LessEqual[x1, -5e-105]], $MachinePrecision], LessEqual[x1, 4.1e-94]]], N[(x1 + N[(N[(x1 * -2.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.45 \cdot 10^{+109} \lor \neg \left(x1 \leq -5 \cdot 10^{-105}\right) \land x1 \leq 4.1 \cdot 10^{-94}:\\
\;\;\;\;x1 + \left(x1 \cdot -2 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\end{array}
\end{array}
if x1 < -1.45e109 or -4.99999999999999963e-105 < x1 < 4.10000000000000001e-94Initial program 75.7%
Taylor expanded in x1 around 0 65.3%
Taylor expanded in x1 around 0 66.2%
fma-define66.3%
fma-neg66.3%
fma-neg66.3%
metadata-eval66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in x2 around 0 71.1%
if -1.45e109 < x1 < -4.99999999999999963e-105 or 4.10000000000000001e-94 < x1 Initial program 74.2%
Taylor expanded in x1 around 0 38.7%
Taylor expanded in x1 around 0 49.0%
fma-define49.0%
fma-neg49.0%
fma-neg49.0%
metadata-eval49.0%
metadata-eval49.0%
Simplified49.0%
Taylor expanded in x1 around inf 45.3%
Final simplification58.0%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -1.2e-184) (not (<= x1 2.5e-152))) (* x1 (+ (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) -1.0)) (* x2 -6.0)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.2e-184) || !(x1 <= 2.5e-152)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-1.2d-184)) .or. (.not. (x1 <= 2.5d-152))) then
tmp = x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) + (-1.0d0))
else
tmp = x2 * (-6.0d0)
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -1.2e-184) || !(x1 <= 2.5e-152)) {
tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0);
} else {
tmp = x2 * -6.0;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -1.2e-184) or not (x1 <= 2.5e-152): tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0) else: tmp = x2 * -6.0 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -1.2e-184) || !(x1 <= 2.5e-152)) tmp = Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) + -1.0)); else tmp = Float64(x2 * -6.0); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -1.2e-184) || ~((x1 <= 2.5e-152))) tmp = x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) + -1.0); else tmp = x2 * -6.0; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -1.2e-184], N[Not[LessEqual[x1, 2.5e-152]], $MachinePrecision]], N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(x2 * -6.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.2 \cdot 10^{-184} \lor \neg \left(x1 \leq 2.5 \cdot 10^{-152}\right):\\
\;\;\;\;x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6\\
\end{array}
\end{array}
if x1 < -1.20000000000000012e-184 or 2.4999999999999998e-152 < x1 Initial program 66.2%
Taylor expanded in x1 around 0 40.4%
Taylor expanded in x1 around 0 48.0%
fma-define48.0%
fma-neg48.0%
fma-neg48.0%
metadata-eval48.0%
metadata-eval48.0%
Simplified48.0%
Taylor expanded in x1 around inf 40.3%
if -1.20000000000000012e-184 < x1 < 2.4999999999999998e-152Initial program 99.6%
Taylor expanded in x1 around 0 84.0%
Taylor expanded in x1 around 0 77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in x1 around 0 77.5%
*-commutative77.5%
Simplified77.5%
Final simplification50.0%
(FPCore (x1 x2) :precision binary64 (if (<= x2 -5.6e-171) (* x2 -6.0) (if (<= x2 1.05e-174) (- x1) (+ x1 (* x2 -6.0)))))
double code(double x1, double x2) {
double tmp;
if (x2 <= -5.6e-171) {
tmp = x2 * -6.0;
} else if (x2 <= 1.05e-174) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x2 <= (-5.6d-171)) then
tmp = x2 * (-6.0d0)
else if (x2 <= 1.05d-174) then
tmp = -x1
else
tmp = x1 + (x2 * (-6.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x2 <= -5.6e-171) {
tmp = x2 * -6.0;
} else if (x2 <= 1.05e-174) {
tmp = -x1;
} else {
tmp = x1 + (x2 * -6.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if x2 <= -5.6e-171: tmp = x2 * -6.0 elif x2 <= 1.05e-174: tmp = -x1 else: tmp = x1 + (x2 * -6.0) return tmp
function code(x1, x2) tmp = 0.0 if (x2 <= -5.6e-171) tmp = Float64(x2 * -6.0); elseif (x2 <= 1.05e-174) tmp = Float64(-x1); else tmp = Float64(x1 + Float64(x2 * -6.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x2 <= -5.6e-171) tmp = x2 * -6.0; elseif (x2 <= 1.05e-174) tmp = -x1; else tmp = x1 + (x2 * -6.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x2, -5.6e-171], N[(x2 * -6.0), $MachinePrecision], If[LessEqual[x2, 1.05e-174], (-x1), N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.6 \cdot 10^{-171}:\\
\;\;\;\;x2 \cdot -6\\
\mathbf{elif}\;x2 \leq 1.05 \cdot 10^{-174}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1 + x2 \cdot -6\\
\end{array}
\end{array}
if x2 < -5.60000000000000046e-171Initial program 74.9%
Taylor expanded in x1 around 0 53.7%
Taylor expanded in x1 around 0 34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in x1 around 0 34.5%
*-commutative34.5%
Simplified34.5%
if -5.60000000000000046e-171 < x2 < 1.05000000000000005e-174Initial program 74.2%
Taylor expanded in x1 around 0 48.8%
Taylor expanded in x1 around 0 49.3%
fma-define49.3%
fma-neg49.3%
fma-neg49.3%
metadata-eval49.3%
metadata-eval49.3%
Simplified49.3%
Taylor expanded in x2 around 0 38.9%
distribute-rgt1-in38.9%
metadata-eval38.9%
neg-mul-138.9%
Simplified38.9%
if 1.05000000000000005e-174 < x2 Initial program 75.5%
Taylor expanded in x1 around 0 51.9%
Taylor expanded in x1 around 0 31.5%
*-commutative31.5%
Simplified31.5%
Final simplification34.4%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3.8e-170) (not (<= x2 1.7e-173))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.8e-170) || !(x2 <= 1.7e-173)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-3.8d-170)) .or. (.not. (x2 <= 1.7d-173))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.8e-170) || !(x2 <= 1.7e-173)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3.8e-170) or not (x2 <= 1.7e-173): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3.8e-170) || !(x2 <= 1.7e-173)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3.8e-170) || ~((x2 <= 1.7e-173))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3.8e-170], N[Not[LessEqual[x2, 1.7e-173]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.8 \cdot 10^{-170} \lor \neg \left(x2 \leq 1.7 \cdot 10^{-173}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -3.7999999999999998e-170 or 1.6999999999999999e-173 < x2 Initial program 75.2%
Taylor expanded in x1 around 0 52.8%
Taylor expanded in x1 around 0 32.9%
*-commutative32.9%
Simplified32.9%
Taylor expanded in x1 around 0 32.5%
*-commutative32.5%
Simplified32.5%
if -3.7999999999999998e-170 < x2 < 1.6999999999999999e-173Initial program 74.2%
Taylor expanded in x1 around 0 48.8%
Taylor expanded in x1 around 0 49.3%
fma-define49.3%
fma-neg49.3%
fma-neg49.3%
metadata-eval49.3%
metadata-eval49.3%
Simplified49.3%
Taylor expanded in x2 around 0 38.9%
distribute-rgt1-in38.9%
metadata-eval38.9%
neg-mul-138.9%
Simplified38.9%
Final simplification34.1%
(FPCore (x1 x2) :precision binary64 (if (<= x1 2.6e-15) (- x1) x1))
double code(double x1, double x2) {
double tmp;
if (x1 <= 2.6e-15) {
tmp = -x1;
} 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 (x1 <= 2.6d-15) then
tmp = -x1
else
tmp = x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= 2.6e-15) {
tmp = -x1;
} else {
tmp = x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= 2.6e-15: tmp = -x1 else: tmp = x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= 2.6e-15) tmp = Float64(-x1); else tmp = x1; end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= 2.6e-15) tmp = -x1; else tmp = x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, 2.6e-15], (-x1), x1]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq 2.6 \cdot 10^{-15}:\\
\;\;\;\;-x1\\
\mathbf{else}:\\
\;\;\;\;x1\\
\end{array}
\end{array}
if x1 < 2.60000000000000004e-15Initial program 81.7%
Taylor expanded in x1 around 0 64.8%
Taylor expanded in x1 around 0 65.5%
fma-define65.6%
fma-neg65.6%
fma-neg65.6%
metadata-eval65.6%
metadata-eval65.6%
Simplified65.6%
Taylor expanded in x2 around 0 18.2%
distribute-rgt1-in18.2%
metadata-eval18.2%
neg-mul-118.2%
Simplified18.2%
if 2.60000000000000004e-15 < x1 Initial program 58.9%
Taylor expanded in x1 around 0 21.0%
Taylor expanded in x1 around 0 5.4%
*-commutative5.4%
Simplified5.4%
Taylor expanded in x1 around inf 6.0%
Final simplification14.5%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 74.9%
Taylor expanded in x1 around 0 51.8%
Taylor expanded in x1 around 0 27.5%
*-commutative27.5%
Simplified27.5%
Taylor expanded in x1 around inf 3.5%
Final simplification3.5%
herbie shell --seed 2024043
(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))))))