
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY)
t_3
(*
(pow x1 4.0)
(+
6.0
(/ (- (/ (+ 15.0 (- (* -4.0 (- 3.0 (* 2.0 x2))) 6.0)) x1) 3.0) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = pow(x1, 4.0) * (6.0 + ((((15.0 + ((-4.0 * (3.0 - (2.0 * x2))) - 6.0)) / x1) - 3.0) / x1));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = Math.pow(x1, 4.0) * (6.0 + ((((15.0 + ((-4.0 * (3.0 - (2.0 * x2))) - 6.0)) / x1) - 3.0) / x1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = math.pow(x1, 4.0) * (6.0 + ((((15.0 + ((-4.0 * (3.0 - (2.0 * x2))) - 6.0)) / x1) - 3.0) / x1)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64((x1 ^ 4.0) * Float64(6.0 + Float64(Float64(Float64(Float64(15.0 + Float64(Float64(-4.0 * Float64(3.0 - Float64(2.0 * x2))) - 6.0)) / x1) - 3.0) / x1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = (x1 ^ 4.0) * (6.0 + ((((15.0 + ((-4.0 * (3.0 - (2.0 * x2))) - 6.0)) / x1) - 3.0) / x1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 + N[(N[(N[(N[(15.0 + N[(N[(-4.0 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision] - 3.0), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 + \frac{\frac{15 + \left(-4 \cdot \left(3 - 2 \cdot x2\right) - 6\right)}{x1} - 3}{x1}\right)\\
\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%
Simplified18.1%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(t_3
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
(if (<= t_3 INFINITY) t_3 (* (pow x1 4.0) (- 6.0 (/ 3.0 x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = pow(x1, 4.0) * (6.0 - (3.0 / x1));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = Math.pow(x1, 4.0) * (6.0 - (3.0 / x1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = math.pow(x1, 4.0) * (6.0 - (3.0 / x1)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 / x1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = (x1 ^ 4.0) * (6.0 - (3.0 / x1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)\\
\mathbf{if}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)\\
\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%
Simplified18.1%
Taylor expanded in x1 around inf 95.8%
associate-*r/95.8%
metadata-eval95.8%
Simplified95.8%
Final simplification98.4%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 x1)))
(t_1 (* (pow x1 4.0) (- 6.0 (/ 3.0 x1))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (- (+ t_2 (* 2.0 x2)) x1))
(t_4 (/ t_3 (- -1.0 (* x1 x1))))
(t_5 (* (* x1 x1) (+ 6.0 (* 4.0 t_4))))
(t_6 (+ (* x1 x1) 1.0))
(t_7 (/ t_3 t_6)))
(if (<= x1 -4e+104)
t_1
(if (<= x1 -5.6e-5)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(-
x1
(-
(+
(* t_2 (- (/ 1.0 x1) 3.0))
(* t_6 (+ t_5 (* (* (* x1 2.0) t_7) (+ 3.0 t_4)))))
t_0))))
(if (<= x1 1e+119)
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_6))
(+
x1
(+
t_0
(-
(* t_2 t_7)
(*
t_6
(+ t_5 (* (- t_7 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
t_1)))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = pow(x1, 4.0) * (6.0 - (3.0 / x1));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double t_4 = t_3 / (-1.0 - (x1 * x1));
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_4));
double t_6 = (x1 * x1) + 1.0;
double t_7 = t_3 / t_6;
double tmp;
if (x1 <= -4e+104) {
tmp = t_1;
} else if (x1 <= -5.6e-5) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((1.0 / x1) - 3.0)) + (t_6 * (t_5 + (((x1 * 2.0) * t_7) * (3.0 + t_4))))) - t_0)));
} else if (x1 <= 1e+119) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_6)) + (x1 + (t_0 + ((t_2 * t_7) - (t_6 * (t_5 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} 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 = x1 * (x1 * x1)
t_1 = (x1 ** 4.0d0) * (6.0d0 - (3.0d0 / x1))
t_2 = x1 * (x1 * 3.0d0)
t_3 = (t_2 + (2.0d0 * x2)) - x1
t_4 = t_3 / ((-1.0d0) - (x1 * x1))
t_5 = (x1 * x1) * (6.0d0 + (4.0d0 * t_4))
t_6 = (x1 * x1) + 1.0d0
t_7 = t_3 / t_6
if (x1 <= (-4d+104)) then
tmp = t_1
else if (x1 <= (-5.6d-5)) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 - (((t_2 * ((1.0d0 / x1) - 3.0d0)) + (t_6 * (t_5 + (((x1 * 2.0d0) * t_7) * (3.0d0 + t_4))))) - t_0)))
else if (x1 <= 1d+119) then
tmp = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_6)) + (x1 + (t_0 + ((t_2 * t_7) - (t_6 * (t_5 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * x1);
double t_1 = Math.pow(x1, 4.0) * (6.0 - (3.0 / x1));
double t_2 = x1 * (x1 * 3.0);
double t_3 = (t_2 + (2.0 * x2)) - x1;
double t_4 = t_3 / (-1.0 - (x1 * x1));
double t_5 = (x1 * x1) * (6.0 + (4.0 * t_4));
double t_6 = (x1 * x1) + 1.0;
double t_7 = t_3 / t_6;
double tmp;
if (x1 <= -4e+104) {
tmp = t_1;
} else if (x1 <= -5.6e-5) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((1.0 / x1) - 3.0)) + (t_6 * (t_5 + (((x1 * 2.0) * t_7) * (3.0 + t_4))))) - t_0)));
} else if (x1 <= 1e+119) {
tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_6)) + (x1 + (t_0 + ((t_2 * t_7) - (t_6 * (t_5 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * x1) t_1 = math.pow(x1, 4.0) * (6.0 - (3.0 / x1)) t_2 = x1 * (x1 * 3.0) t_3 = (t_2 + (2.0 * x2)) - x1 t_4 = t_3 / (-1.0 - (x1 * x1)) t_5 = (x1 * x1) * (6.0 + (4.0 * t_4)) t_6 = (x1 * x1) + 1.0 t_7 = t_3 / t_6 tmp = 0 if x1 <= -4e+104: tmp = t_1 elif x1 <= -5.6e-5: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((1.0 / x1) - 3.0)) + (t_6 * (t_5 + (((x1 * 2.0) * t_7) * (3.0 + t_4))))) - t_0))) elif x1 <= 1e+119: tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_6)) + (x1 + (t_0 + ((t_2 * t_7) - (t_6 * (t_5 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * x1)) t_1 = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 / x1))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) t_4 = Float64(t_3 / Float64(-1.0 - Float64(x1 * x1))) t_5 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_4))) t_6 = Float64(Float64(x1 * x1) + 1.0) t_7 = Float64(t_3 / t_6) tmp = 0.0 if (x1 <= -4e+104) tmp = t_1; elseif (x1 <= -5.6e-5) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 - Float64(Float64(Float64(t_2 * Float64(Float64(1.0 / x1) - 3.0)) + Float64(t_6 * Float64(t_5 + Float64(Float64(Float64(x1 * 2.0) * t_7) * Float64(3.0 + t_4))))) - t_0)))); elseif (x1 <= 1e+119) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_6)) + Float64(x1 + Float64(t_0 + Float64(Float64(t_2 * t_7) - Float64(t_6 * Float64(t_5 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * x1); t_1 = (x1 ^ 4.0) * (6.0 - (3.0 / x1)); t_2 = x1 * (x1 * 3.0); t_3 = (t_2 + (2.0 * x2)) - x1; t_4 = t_3 / (-1.0 - (x1 * x1)); t_5 = (x1 * x1) * (6.0 + (4.0 * t_4)); t_6 = (x1 * x1) + 1.0; t_7 = t_3 / t_6; tmp = 0.0; if (x1 <= -4e+104) tmp = t_1; elseif (x1 <= -5.6e-5) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 - (((t_2 * ((1.0 / x1) - 3.0)) + (t_6 * (t_5 + (((x1 * 2.0) * t_7) * (3.0 + t_4))))) - t_0))); elseif (x1 <= 1e+119) tmp = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_6)) + (x1 + (t_0 + ((t_2 * t_7) - (t_6 * (t_5 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 / t$95$6), $MachinePrecision]}, If[LessEqual[x1, -4e+104], t$95$1, If[LessEqual[x1, -5.6e-5], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 - N[(N[(N[(t$95$2 * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(t$95$5 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision] * N[(3.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1e+119], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(t$95$0 + N[(N[(t$95$2 * t$95$7), $MachinePrecision] - N[(t$95$6 * N[(t$95$5 + N[(N[(t$95$7 - 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$1]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot x1\right)\\
t_1 := {x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \left(t\_2 + 2 \cdot x2\right) - x1\\
t_4 := \frac{t\_3}{-1 - x1 \cdot x1}\\
t_5 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_4\right)\\
t_6 := x1 \cdot x1 + 1\\
t_7 := \frac{t\_3}{t\_6}\\
\mathbf{if}\;x1 \leq -4 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -5.6 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 - \left(\left(t\_2 \cdot \left(\frac{1}{x1} - 3\right) + t\_6 \cdot \left(t\_5 + \left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(3 + t\_4\right)\right)\right) - t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 10^{+119}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_6} + \left(x1 + \left(t\_0 + \left(t\_2 \cdot t\_7 - t\_6 \cdot \left(t\_5 + \left(t\_7 - 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\_1\\
\end{array}
\end{array}
if x1 < -4e104 or 9.99999999999999944e118 < x1 Initial program 10.1%
Simplified25.3%
Taylor expanded in x1 around inf 97.5%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
if -4e104 < x1 < -5.59999999999999992e-5Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around inf 99.5%
if -5.59999999999999992e-5 < x1 < 9.99999999999999944e118Initial program 98.6%
Taylor expanded in x1 around 0 97.2%
+-commutative97.2%
mul-1-neg97.2%
unsub-neg97.2%
Simplified97.2%
Final simplification97.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(if (or (<= x1 -5.6e+102) (not (<= x1 2.7e+73)))
(* (pow x1 4.0) (- 6.0 (/ 3.0 x1)))
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* (* x1 2.0) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* t_2 4.0) 6.0))))
(* t_0 t_2))
(* x1 (* x1 x1))))
(* 3.0 (- (* x2 -2.0) x1)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double tmp;
if ((x1 <= -5.6e+102) || !(x1 <= 2.7e+73)) {
tmp = pow(x1, 4.0) * (6.0 - (3.0 / x1));
} else {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
if ((x1 <= (-5.6d+102)) .or. (.not. (x1 <= 2.7d+73))) then
tmp = (x1 ** 4.0d0) * (6.0d0 - (3.0d0 / x1))
else
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0d0) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((t_2 * 4.0d0) - 6.0d0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0d0 * ((x2 * (-2.0d0)) - x1)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 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.6e+102) || !(x1 <= 2.7e+73)) {
tmp = Math.pow(x1, 4.0) * (6.0 - (3.0 / x1));
} else {
tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 tmp = 0 if (x1 <= -5.6e+102) or not (x1 <= 2.7e+73): tmp = math.pow(x1, 4.0) * (6.0 - (3.0 / x1)) else: tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) tmp = 0.0 if ((x1 <= -5.6e+102) || !(x1 <= 2.7e+73)) tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 / x1))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = 0.0; if ((x1 <= -5.6e+102) || ~((x1 <= 2.7e+73))) tmp = (x1 ^ 4.0) * (6.0 - (3.0 / x1)); else tmp = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * ((x2 * -2.0) - x1))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[x1, -5.6e+102], N[Not[LessEqual[x1, 2.7e+73]], $MachinePrecision]], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102} \lor \neg \left(x1 \leq 2.7 \cdot 10^{+73}\right):\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(\left(x1 \cdot 2\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(t\_2 \cdot 4 - 6\right)\right) + t\_0 \cdot t\_2\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102 or 2.6999999999999999e73 < x1 Initial program 18.2%
Simplified33.0%
Taylor expanded in x1 around inf 96.6%
associate-*r/96.6%
metadata-eval96.6%
Simplified96.6%
if -5.60000000000000037e102 < x1 < 2.6999999999999999e73Initial program 99.3%
Taylor expanded in x1 around 0 98.9%
mul-1-neg98.9%
unsub-neg98.9%
*-commutative98.9%
Simplified98.9%
Final simplification98.1%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 3.0 (- (* x2 -2.0) x1)))
(t_1 (* x1 (* x1 x1)))
(t_2 (* (pow x1 4.0) (- 6.0 (/ 3.0 x1))))
(t_3 (* x1 (* x1 3.0)))
(t_4 (- (+ t_3 (* 2.0 x2)) x1))
(t_5 (/ t_4 (- -1.0 (* x1 x1))))
(t_6 (* (* x1 x1) (+ 6.0 (* 4.0 t_5))))
(t_7 (+ (* x1 x1) 1.0))
(t_8 (/ t_4 t_7)))
(if (<= x1 -5e+102)
t_2
(if (<= x1 -1e-5)
(+
x1
(+
t_0
(-
x1
(-
(+
(* t_3 (- (/ 1.0 x1) 3.0))
(* t_7 (+ t_6 (* (* (* x1 2.0) t_8) (+ 3.0 t_5)))))
t_1))))
(if (<= x1 6e+118)
(+
x1
(+
t_0
(+
x1
(+
t_1
(-
(* t_3 t_8)
(*
t_7
(+ t_6 (* (- t_8 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
t_2)))))
double code(double x1, double x2) {
double t_0 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * x1);
double t_2 = pow(x1, 4.0) * (6.0 - (3.0 / x1));
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = (x1 * x1) * (6.0 + (4.0 * t_5));
double t_7 = (x1 * x1) + 1.0;
double t_8 = t_4 / t_7;
double tmp;
if (x1 <= -5e+102) {
tmp = t_2;
} else if (x1 <= -1e-5) {
tmp = x1 + (t_0 + (x1 - (((t_3 * ((1.0 / x1) - 3.0)) + (t_7 * (t_6 + (((x1 * 2.0) * t_8) * (3.0 + t_5))))) - t_1)));
} else if (x1 <= 6e+118) {
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_3 * t_8) - (t_7 * (t_6 + ((t_8 - 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 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_1 = x1 * (x1 * x1)
t_2 = (x1 ** 4.0d0) * (6.0d0 - (3.0d0 / x1))
t_3 = x1 * (x1 * 3.0d0)
t_4 = (t_3 + (2.0d0 * x2)) - x1
t_5 = t_4 / ((-1.0d0) - (x1 * x1))
t_6 = (x1 * x1) * (6.0d0 + (4.0d0 * t_5))
t_7 = (x1 * x1) + 1.0d0
t_8 = t_4 / t_7
if (x1 <= (-5d+102)) then
tmp = t_2
else if (x1 <= (-1d-5)) then
tmp = x1 + (t_0 + (x1 - (((t_3 * ((1.0d0 / x1) - 3.0d0)) + (t_7 * (t_6 + (((x1 * 2.0d0) * t_8) * (3.0d0 + t_5))))) - t_1)))
else if (x1 <= 6d+118) then
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_3 * t_8) - (t_7 * (t_6 + ((t_8 - 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 = 3.0 * ((x2 * -2.0) - x1);
double t_1 = x1 * (x1 * x1);
double t_2 = Math.pow(x1, 4.0) * (6.0 - (3.0 / x1));
double t_3 = x1 * (x1 * 3.0);
double t_4 = (t_3 + (2.0 * x2)) - x1;
double t_5 = t_4 / (-1.0 - (x1 * x1));
double t_6 = (x1 * x1) * (6.0 + (4.0 * t_5));
double t_7 = (x1 * x1) + 1.0;
double t_8 = t_4 / t_7;
double tmp;
if (x1 <= -5e+102) {
tmp = t_2;
} else if (x1 <= -1e-5) {
tmp = x1 + (t_0 + (x1 - (((t_3 * ((1.0 / x1) - 3.0)) + (t_7 * (t_6 + (((x1 * 2.0) * t_8) * (3.0 + t_5))))) - t_1)));
} else if (x1 <= 6e+118) {
tmp = x1 + (t_0 + (x1 + (t_1 + ((t_3 * t_8) - (t_7 * (t_6 + ((t_8 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x1, x2): t_0 = 3.0 * ((x2 * -2.0) - x1) t_1 = x1 * (x1 * x1) t_2 = math.pow(x1, 4.0) * (6.0 - (3.0 / x1)) t_3 = x1 * (x1 * 3.0) t_4 = (t_3 + (2.0 * x2)) - x1 t_5 = t_4 / (-1.0 - (x1 * x1)) t_6 = (x1 * x1) * (6.0 + (4.0 * t_5)) t_7 = (x1 * x1) + 1.0 t_8 = t_4 / t_7 tmp = 0 if x1 <= -5e+102: tmp = t_2 elif x1 <= -1e-5: tmp = x1 + (t_0 + (x1 - (((t_3 * ((1.0 / x1) - 3.0)) + (t_7 * (t_6 + (((x1 * 2.0) * t_8) * (3.0 + t_5))))) - t_1))) elif x1 <= 6e+118: tmp = x1 + (t_0 + (x1 + (t_1 + ((t_3 * t_8) - (t_7 * (t_6 + ((t_8 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = t_2 return tmp
function code(x1, x2) t_0 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_1 = Float64(x1 * Float64(x1 * x1)) t_2 = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(3.0 / x1))) t_3 = Float64(x1 * Float64(x1 * 3.0)) t_4 = Float64(Float64(t_3 + Float64(2.0 * x2)) - x1) t_5 = Float64(t_4 / Float64(-1.0 - Float64(x1 * x1))) t_6 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) t_7 = Float64(Float64(x1 * x1) + 1.0) t_8 = Float64(t_4 / t_7) tmp = 0.0 if (x1 <= -5e+102) tmp = t_2; elseif (x1 <= -1e-5) tmp = Float64(x1 + Float64(t_0 + Float64(x1 - Float64(Float64(Float64(t_3 * Float64(Float64(1.0 / x1) - 3.0)) + Float64(t_7 * Float64(t_6 + Float64(Float64(Float64(x1 * 2.0) * t_8) * Float64(3.0 + t_5))))) - t_1)))); elseif (x1 <= 6e+118) tmp = Float64(x1 + Float64(t_0 + Float64(x1 + Float64(t_1 + Float64(Float64(t_3 * t_8) - Float64(t_7 * Float64(t_6 + Float64(Float64(t_8 - 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 = 3.0 * ((x2 * -2.0) - x1); t_1 = x1 * (x1 * x1); t_2 = (x1 ^ 4.0) * (6.0 - (3.0 / x1)); t_3 = x1 * (x1 * 3.0); t_4 = (t_3 + (2.0 * x2)) - x1; t_5 = t_4 / (-1.0 - (x1 * x1)); t_6 = (x1 * x1) * (6.0 + (4.0 * t_5)); t_7 = (x1 * x1) + 1.0; t_8 = t_4 / t_7; tmp = 0.0; if (x1 <= -5e+102) tmp = t_2; elseif (x1 <= -1e-5) tmp = x1 + (t_0 + (x1 - (((t_3 * ((1.0 / x1) - 3.0)) + (t_7 * (t_6 + (((x1 * 2.0) * t_8) * (3.0 + t_5))))) - t_1))); elseif (x1 <= 6e+118) tmp = x1 + (t_0 + (x1 + (t_1 + ((t_3 * t_8) - (t_7 * (t_6 + ((t_8 - 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[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(3.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$4 / t$95$7), $MachinePrecision]}, If[LessEqual[x1, -5e+102], t$95$2, If[LessEqual[x1, -1e-5], N[(x1 + N[(t$95$0 + N[(x1 - N[(N[(N[(t$95$3 * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 * N[(t$95$6 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$8), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e+118], N[(x1 + N[(t$95$0 + N[(x1 + N[(t$95$1 + N[(N[(t$95$3 * t$95$8), $MachinePrecision] - N[(t$95$7 * N[(t$95$6 + N[(N[(t$95$8 - 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 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_1 := x1 \cdot \left(x1 \cdot x1\right)\\
t_2 := {x1}^{4} \cdot \left(6 - \frac{3}{x1}\right)\\
t_3 := x1 \cdot \left(x1 \cdot 3\right)\\
t_4 := \left(t\_3 + 2 \cdot x2\right) - x1\\
t_5 := \frac{t\_4}{-1 - x1 \cdot x1}\\
t_6 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right)\\
t_7 := x1 \cdot x1 + 1\\
t_8 := \frac{t\_4}{t\_7}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 - \left(\left(t\_3 \cdot \left(\frac{1}{x1} - 3\right) + t\_7 \cdot \left(t\_6 + \left(\left(x1 \cdot 2\right) \cdot t\_8\right) \cdot \left(3 + t\_5\right)\right)\right) - t\_1\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{+118}:\\
\;\;\;\;x1 + \left(t\_0 + \left(x1 + \left(t\_1 + \left(t\_3 \cdot t\_8 - t\_7 \cdot \left(t\_6 + \left(t\_8 - 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 6e118 < x1 Initial program 10.1%
Simplified25.3%
Taylor expanded in x1 around inf 97.5%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
if -5e102 < x1 < -1.00000000000000008e-5Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around inf 99.5%
if -1.00000000000000008e-5 < x1 < 6e118Initial program 98.6%
Taylor expanded in x1 around 0 98.2%
mul-1-neg98.2%
unsub-neg98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x1 around 0 96.7%
+-commutative97.2%
mul-1-neg97.2%
unsub-neg97.2%
Simplified96.7%
Final simplification97.2%
(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)) x1) t_0))
(t_3
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(-
(* x1 (* x1 x1))
(-
(* t_1 t_2)
(*
t_0
(+
(* (* x1 (+ 6.0 (/ -2.0 x1))) (+ 3.0 t_2))
(* (* x1 x1) (+ 6.0 (* 4.0 t_2))))))))))))
(if (<= x1 -5.6e+102)
(-
(* x2 -6.0)
(*
x1
(-
(-
(* x2 (- 12.0 (* x1 (+ 12.0 (* x1 24.0)))))
(* x1 (+ 9.0 (* x1 -19.0))))
-1.0)))
(if (<= x1 -3100.0)
t_3
(if (<= x1 12000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5.2e+141)
t_3
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.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)) - x1) / t_0;
double t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * t_2) - (t_0 * (((x1 * (6.0 + (-2.0 / x1))) * (3.0 + t_2)) + ((x1 * x1) * (6.0 + (4.0 * t_2)))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= -3100.0) {
tmp = t_3;
} else if (x1 <= 12000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5.2e+141) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (-1.0d0) - (x1 * x1)
t_1 = x1 * (x1 * 3.0d0)
t_2 = ((t_1 + (2.0d0 * x2)) - x1) / t_0
t_3 = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * t_2) - (t_0 * (((x1 * (6.0d0 + ((-2.0d0) / x1))) * (3.0d0 + t_2)) + ((x1 * x1) * (6.0d0 + (4.0d0 * t_2)))))))))
if (x1 <= (-5.6d+102)) then
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x1 * (12.0d0 + (x1 * 24.0d0))))) - (x1 * (9.0d0 + (x1 * (-19.0d0))))) - (-1.0d0)))
else if (x1 <= (-3100.0d0)) then
tmp = t_3
else if (x1 <= 12000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5.2d+141) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.0d0))))))
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 * 3.0);
double t_2 = ((t_1 + (2.0 * x2)) - x1) / t_0;
double t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * t_2) - (t_0 * (((x1 * (6.0 + (-2.0 / x1))) * (3.0 + t_2)) + ((x1 * x1) * (6.0 + (4.0 * t_2)))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= -3100.0) {
tmp = t_3;
} else if (x1 <= 12000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5.2e+141) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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)) - x1) / t_0 t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * t_2) - (t_0 * (((x1 * (6.0 + (-2.0 / x1))) * (3.0 + t_2)) + ((x1 * x1) * (6.0 + (4.0 * t_2))))))))) tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)) elif x1 <= -3100.0: tmp = t_3 elif x1 <= 12000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5.2e+141: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) - Float64(Float64(t_1 * t_2) - Float64(t_0 * Float64(Float64(Float64(x1 * Float64(6.0 + Float64(-2.0 / x1))) * Float64(3.0 + t_2)) + Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2)))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x1 * Float64(12.0 + Float64(x1 * 24.0))))) - Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))) - -1.0))); elseif (x1 <= -3100.0) tmp = t_3; elseif (x1 <= 12000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5.2e+141) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.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)) - x1) / t_0; t_3 = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) - ((t_1 * t_2) - (t_0 * (((x1 * (6.0 + (-2.0 / x1))) * (3.0 + t_2)) + ((x1 * x1) * (6.0 + (4.0 * t_2))))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)); elseif (x1 <= -3100.0) tmp = t_3; elseif (x1 <= 12000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5.2e+141) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * t$95$2), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * N[(6.0 + N[(-2.0 / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x1 * N[(12.0 + N[(x1 * 24.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -3100.0], t$95$3, If[LessEqual[x1, 12000.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 5.2e+141], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_0}\\
t_3 := x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) - \left(t\_1 \cdot t\_2 - t\_0 \cdot \left(\left(x1 \cdot \left(6 + \frac{-2}{x1}\right)\right) \cdot \left(3 + t\_2\right) + \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x1 \cdot \left(12 + x1 \cdot 24\right)\right) - x1 \cdot \left(9 + x1 \cdot -19\right)\right) - -1\right)\\
\mathbf{elif}\;x1 \leq -3100:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 12000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+141}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Simplified27.8%
Taylor expanded in x1 around 0 55.6%
Taylor expanded in x2 around 0 61.1%
if -5.60000000000000037e102 < x1 < -3100 or 12000 < x1 < 5.1999999999999999e141Initial program 95.8%
add-cube-cbrt95.7%
pow395.7%
Applied egg-rr95.7%
Taylor expanded in x1 around 0 95.7%
mul-1-neg95.8%
unsub-neg95.8%
*-commutative95.8%
Simplified95.7%
Taylor expanded in x1 around inf 81.9%
rem-cube-cbrt81.9%
associate-*r/81.9%
metadata-eval81.9%
rem-cube-cbrt81.9%
metadata-eval81.9%
Simplified81.9%
if -3100 < x1 < 12000Initial program 99.3%
Simplified87.0%
Taylor expanded in x1 around 0 84.6%
fma-define84.7%
metadata-eval84.7%
cancel-sign-sub-inv84.7%
associate-*r*84.7%
fmm-def84.7%
*-commutative84.7%
cancel-sign-sub-inv84.7%
metadata-eval84.7%
*-commutative84.7%
metadata-eval84.7%
Simplified84.7%
Taylor expanded in x2 around 0 97.5%
if 5.1999999999999999e141 < x1 Initial program 8.1%
Simplified10.8%
Taylor expanded in x1 around 0 78.6%
Taylor expanded in x2 around 0 70.5%
Taylor expanded in x1 around 0 81.3%
Final simplification86.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- (+ t_0 (* 2.0 x2)) x1))
(t_2 (/ t_1 (- -1.0 (* x1 x1))))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (* (* x1 x1) (+ 6.0 (* 4.0 t_2))))
(t_5 (* x1 (* x1 x1)))
(t_6 (* 3.0 (- (* x2 -2.0) x1)))
(t_7 (/ t_1 t_3)))
(if (<= x1 -5.6e+102)
(-
(* x2 -6.0)
(*
x1
(-
(-
(* x2 (- 12.0 (* x1 (+ 12.0 (* x1 24.0)))))
(* x1 (+ 9.0 (* x1 -19.0))))
-1.0)))
(if (<= x1 -4.2e-5)
(+
x1
(+
t_6
(-
x1
(-
(+
(* t_0 (- (/ 1.0 x1) 3.0))
(* t_3 (+ t_4 (* (* (* x1 2.0) t_7) (+ 3.0 t_2)))))
t_5))))
(if (<= x1 5.2e+141)
(+
x1
(+
t_6
(+
x1
(+
t_5
(-
(* t_0 t_7)
(*
t_3
(+ t_4 (* (- t_7 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = t_1 / (-1.0 - (x1 * x1));
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (6.0 + (4.0 * t_2));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * ((x2 * -2.0) - x1);
double t_7 = t_1 / t_3;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= -4.2e-5) {
tmp = x1 + (t_6 + (x1 - (((t_0 * ((1.0 / x1) - 3.0)) + (t_3 * (t_4 + (((x1 * 2.0) * t_7) * (3.0 + t_2))))) - t_5)));
} else if (x1 <= 5.2e+141) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((t_0 * t_7) - (t_3 * (t_4 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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) :: t_7
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (t_0 + (2.0d0 * x2)) - x1
t_2 = t_1 / ((-1.0d0) - (x1 * x1))
t_3 = (x1 * x1) + 1.0d0
t_4 = (x1 * x1) * (6.0d0 + (4.0d0 * t_2))
t_5 = x1 * (x1 * x1)
t_6 = 3.0d0 * ((x2 * (-2.0d0)) - x1)
t_7 = t_1 / t_3
if (x1 <= (-5.6d+102)) then
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x1 * (12.0d0 + (x1 * 24.0d0))))) - (x1 * (9.0d0 + (x1 * (-19.0d0))))) - (-1.0d0)))
else if (x1 <= (-4.2d-5)) then
tmp = x1 + (t_6 + (x1 - (((t_0 * ((1.0d0 / x1) - 3.0d0)) + (t_3 * (t_4 + (((x1 * 2.0d0) * t_7) * (3.0d0 + t_2))))) - t_5)))
else if (x1 <= 5.2d+141) then
tmp = x1 + (t_6 + (x1 + (t_5 + ((t_0 * t_7) - (t_3 * (t_4 + ((t_7 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (t_0 + (2.0 * x2)) - x1;
double t_2 = t_1 / (-1.0 - (x1 * x1));
double t_3 = (x1 * x1) + 1.0;
double t_4 = (x1 * x1) * (6.0 + (4.0 * t_2));
double t_5 = x1 * (x1 * x1);
double t_6 = 3.0 * ((x2 * -2.0) - x1);
double t_7 = t_1 / t_3;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= -4.2e-5) {
tmp = x1 + (t_6 + (x1 - (((t_0 * ((1.0 / x1) - 3.0)) + (t_3 * (t_4 + (((x1 * 2.0) * t_7) * (3.0 + t_2))))) - t_5)));
} else if (x1 <= 5.2e+141) {
tmp = x1 + (t_6 + (x1 + (t_5 + ((t_0 * t_7) - (t_3 * (t_4 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (t_0 + (2.0 * x2)) - x1 t_2 = t_1 / (-1.0 - (x1 * x1)) t_3 = (x1 * x1) + 1.0 t_4 = (x1 * x1) * (6.0 + (4.0 * t_2)) t_5 = x1 * (x1 * x1) t_6 = 3.0 * ((x2 * -2.0) - x1) t_7 = t_1 / t_3 tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)) elif x1 <= -4.2e-5: tmp = x1 + (t_6 + (x1 - (((t_0 * ((1.0 / x1) - 3.0)) + (t_3 * (t_4 + (((x1 * 2.0) * t_7) * (3.0 + t_2))))) - t_5))) elif x1 <= 5.2e+141: tmp = x1 + (t_6 + (x1 + (t_5 + ((t_0 * t_7) - (t_3 * (t_4 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) t_2 = Float64(t_1 / Float64(-1.0 - Float64(x1 * x1))) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_2))) t_5 = Float64(x1 * Float64(x1 * x1)) t_6 = Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) t_7 = Float64(t_1 / t_3) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x1 * Float64(12.0 + Float64(x1 * 24.0))))) - Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))) - -1.0))); elseif (x1 <= -4.2e-5) tmp = Float64(x1 + Float64(t_6 + Float64(x1 - Float64(Float64(Float64(t_0 * Float64(Float64(1.0 / x1) - 3.0)) + Float64(t_3 * Float64(t_4 + Float64(Float64(Float64(x1 * 2.0) * t_7) * Float64(3.0 + t_2))))) - t_5)))); elseif (x1 <= 5.2e+141) tmp = Float64(x1 + Float64(t_6 + Float64(x1 + Float64(t_5 + Float64(Float64(t_0 * t_7) - Float64(t_3 * Float64(t_4 + Float64(Float64(t_7 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (t_0 + (2.0 * x2)) - x1; t_2 = t_1 / (-1.0 - (x1 * x1)); t_3 = (x1 * x1) + 1.0; t_4 = (x1 * x1) * (6.0 + (4.0 * t_2)); t_5 = x1 * (x1 * x1); t_6 = 3.0 * ((x2 * -2.0) - x1); t_7 = t_1 / t_3; tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)); elseif (x1 <= -4.2e-5) tmp = x1 + (t_6 + (x1 - (((t_0 * ((1.0 / x1) - 3.0)) + (t_3 * (t_4 + (((x1 * 2.0) * t_7) * (3.0 + t_2))))) - t_5))); elseif (x1 <= 5.2e+141) tmp = x1 + (t_6 + (x1 + (t_5 + ((t_0 * t_7) - (t_3 * (t_4 + ((t_7 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$1 / t$95$3), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x1 * N[(12.0 + N[(x1 * 24.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -4.2e-5], N[(x1 + N[(t$95$6 + N[(x1 - N[(N[(N[(t$95$0 * N[(N[(1.0 / x1), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(t$95$4 + N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$7), $MachinePrecision] * N[(3.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.2e+141], N[(x1 + N[(t$95$6 + N[(x1 + N[(t$95$5 + N[(N[(t$95$0 * t$95$7), $MachinePrecision] - N[(t$95$3 * N[(t$95$4 + N[(N[(t$95$7 - 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], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \left(t\_0 + 2 \cdot x2\right) - x1\\
t_2 := \frac{t\_1}{-1 - x1 \cdot x1}\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_2\right)\\
t_5 := x1 \cdot \left(x1 \cdot x1\right)\\
t_6 := 3 \cdot \left(x2 \cdot -2 - x1\right)\\
t_7 := \frac{t\_1}{t\_3}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x1 \cdot \left(12 + x1 \cdot 24\right)\right) - x1 \cdot \left(9 + x1 \cdot -19\right)\right) - -1\right)\\
\mathbf{elif}\;x1 \leq -4.2 \cdot 10^{-5}:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 - \left(\left(t\_0 \cdot \left(\frac{1}{x1} - 3\right) + t\_3 \cdot \left(t\_4 + \left(\left(x1 \cdot 2\right) \cdot t\_7\right) \cdot \left(3 + t\_2\right)\right)\right) - t\_5\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+141}:\\
\;\;\;\;x1 + \left(t\_6 + \left(x1 + \left(t\_5 + \left(t\_0 \cdot t\_7 - t\_3 \cdot \left(t\_4 + \left(t\_7 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Simplified27.8%
Taylor expanded in x1 around 0 55.6%
Taylor expanded in x2 around 0 61.1%
if -5.60000000000000037e102 < x1 < -4.19999999999999977e-5Initial program 99.5%
Taylor expanded in x1 around 0 99.5%
mul-1-neg99.5%
unsub-neg99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x1 around inf 99.5%
if -4.19999999999999977e-5 < x1 < 5.1999999999999999e141Initial program 98.0%
Taylor expanded in x1 around 0 97.6%
mul-1-neg97.6%
unsub-neg97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in x1 around 0 96.2%
+-commutative96.6%
mul-1-neg96.6%
unsub-neg96.6%
Simplified96.2%
if 5.1999999999999999e141 < x1 Initial program 8.1%
Simplified10.8%
Taylor expanded in x1 around 0 78.6%
Taylor expanded in x2 around 0 70.5%
Taylor expanded in x1 around 0 81.3%
Final simplification89.5%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- (+ t_1 (* 2.0 x2)) x1))
(t_3 (/ t_2 t_0)))
(if (<= x1 -5.6e+102)
(-
(* x2 -6.0)
(*
x1
(-
(-
(* x2 (- 12.0 (* x1 (+ 12.0 (* x1 24.0)))))
(* x1 (+ 9.0 (* x1 -19.0))))
-1.0)))
(if (<= x1 5.2e+141)
(+
x1
(+
(* 3.0 (- (* x2 -2.0) x1))
(+
x1
(+
(* x1 (* x1 x1))
(-
(* t_1 t_3)
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 (/ t_2 (- -1.0 (* x1 x1))))))
(* (- t_3 3.0) (* (* x1 2.0) (- x1 (* 2.0 x2)))))))))))
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.0)))))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 5.2e+141) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (t_2 / (-1.0 - (x1 * x1)))))) + ((t_3 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = (t_1 + (2.0d0 * x2)) - x1
t_3 = t_2 / t_0
if (x1 <= (-5.6d+102)) then
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x1 * (12.0d0 + (x1 * 24.0d0))))) - (x1 * (9.0d0 + (x1 * (-19.0d0))))) - (-1.0d0)))
else if (x1 <= 5.2d+141) then
tmp = x1 + ((3.0d0 * ((x2 * (-2.0d0)) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) - (t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * (t_2 / ((-1.0d0) - (x1 * x1)))))) + ((t_3 - 3.0d0) * ((x1 * 2.0d0) * (x1 - (2.0d0 * x2))))))))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = (t_1 + (2.0 * x2)) - x1;
double t_3 = t_2 / t_0;
double tmp;
if (x1 <= -5.6e+102) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 5.2e+141) {
tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (t_2 / (-1.0 - (x1 * x1)))))) + ((t_3 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2))))))))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = (t_1 + (2.0 * x2)) - x1 t_3 = t_2 / t_0 tmp = 0 if x1 <= -5.6e+102: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)) elif x1 <= 5.2e+141: tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (t_2 / (-1.0 - (x1 * x1)))))) + ((t_3 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))) return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) t_3 = Float64(t_2 / t_0) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x1 * Float64(12.0 + Float64(x1 * 24.0))))) - Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))) - -1.0))); elseif (x1 <= 5.2e+141) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) - Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * Float64(t_2 / Float64(-1.0 - Float64(x1 * x1)))))) + Float64(Float64(t_3 - 3.0) * Float64(Float64(x1 * 2.0) * Float64(x1 - Float64(2.0 * x2))))))))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 * (x1 * 3.0); t_2 = (t_1 + (2.0 * x2)) - x1; t_3 = t_2 / t_0; tmp = 0.0; if (x1 <= -5.6e+102) tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)); elseif (x1 <= 5.2e+141) tmp = x1 + ((3.0 * ((x2 * -2.0) - x1)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) - (t_0 * (((x1 * x1) * (6.0 + (4.0 * (t_2 / (-1.0 - (x1 * x1)))))) + ((t_3 - 3.0) * ((x1 * 2.0) * (x1 - (2.0 * x2)))))))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x1 * N[(12.0 + N[(x1 * 24.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.2e+141], N[(x1 + N[(N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] - N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * N[(t$95$2 / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - 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], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := \left(t\_1 + 2 \cdot x2\right) - x1\\
t_3 := \frac{t\_2}{t\_0}\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x1 \cdot \left(12 + x1 \cdot 24\right)\right) - x1 \cdot \left(9 + x1 \cdot -19\right)\right) - -1\right)\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+141}:\\
\;\;\;\;x1 + \left(3 \cdot \left(x2 \cdot -2 - x1\right) + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 - t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot \frac{t\_2}{-1 - x1 \cdot x1}\right) + \left(t\_3 - 3\right) \cdot \left(\left(x1 \cdot 2\right) \cdot \left(x1 - 2 \cdot x2\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 0.0%
Simplified27.8%
Taylor expanded in x1 around 0 55.6%
Taylor expanded in x2 around 0 61.1%
if -5.60000000000000037e102 < x1 < 5.1999999999999999e141Initial program 98.3%
Taylor expanded in x1 around 0 97.9%
mul-1-neg97.9%
unsub-neg97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x1 around 0 94.3%
+-commutative94.7%
mul-1-neg94.7%
unsub-neg94.7%
Simplified94.3%
if 5.1999999999999999e141 < x1 Initial program 8.1%
Simplified10.8%
Taylor expanded in x1 around 0 78.6%
Taylor expanded in x2 around 0 70.5%
Taylor expanded in x1 around 0 81.3%
Final simplification87.7%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (- -1.0 (* x1 x1))))
(if (<= x1 -4.8e+74)
(-
(* x2 -6.0)
(*
x1
(-
(-
(* x2 (- 12.0 (* x1 (+ 12.0 (* x1 24.0)))))
(* x1 (+ 9.0 (* x1 -19.0))))
-1.0)))
(if (<= x1 850.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5.4e+118)
(-
x1
(+
(-
(-
(+
(* t_0 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1))
(*
(*
x1
(-
(* 4.0 (* x2 (- (* 2.0 x2) 3.0)))
(*
x1
(-
6.0
(+
(* 2.0 (+ (* x2 -2.0) (- 3.0 (* 2.0 x2))))
(* x2 8.0))))))
t_1))
(* x1 (* x1 x1)))
x1)
(* 3.0 (- x1 (* x2 -2.0)))))
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.0))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = -1.0 - (x1 * x1);
double tmp;
if (x1 <= -4.8e+74) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 850.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5.4e+118) {
tmp = x1 - (((((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - (x1 * (6.0 - ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + (x2 * 8.0)))))) * t_1)) - (x1 * (x1 * x1))) - x1) + (3.0 * (x1 - (x2 * -2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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 * 3.0d0)
t_1 = (-1.0d0) - (x1 * x1)
if (x1 <= (-4.8d+74)) then
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x1 * (12.0d0 + (x1 * 24.0d0))))) - (x1 * (9.0d0 + (x1 * (-19.0d0))))) - (-1.0d0)))
else if (x1 <= 850.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5.4d+118) then
tmp = x1 - (((((t_0 * (((t_0 + (2.0d0 * x2)) - x1) / t_1)) + ((x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - (x1 * (6.0d0 - ((2.0d0 * ((x2 * (-2.0d0)) + (3.0d0 - (2.0d0 * x2)))) + (x2 * 8.0d0)))))) * t_1)) - (x1 * (x1 * x1))) - x1) + (3.0d0 * (x1 - (x2 * (-2.0d0)))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.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 = -1.0 - (x1 * x1);
double tmp;
if (x1 <= -4.8e+74) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 850.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5.4e+118) {
tmp = x1 - (((((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - (x1 * (6.0 - ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + (x2 * 8.0)))))) * t_1)) - (x1 * (x1 * x1))) - x1) + (3.0 * (x1 - (x2 * -2.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = -1.0 - (x1 * x1) tmp = 0 if x1 <= -4.8e+74: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)) elif x1 <= 850.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5.4e+118: tmp = x1 - (((((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - (x1 * (6.0 - ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + (x2 * 8.0)))))) * t_1)) - (x1 * (x1 * x1))) - x1) + (3.0 * (x1 - (x2 * -2.0)))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(-1.0 - Float64(x1 * x1)) tmp = 0.0 if (x1 <= -4.8e+74) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x1 * Float64(12.0 + Float64(x1 * 24.0))))) - Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))) - -1.0))); elseif (x1 <= 850.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5.4e+118) tmp = Float64(x1 - Float64(Float64(Float64(Float64(Float64(t_0 * Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1)) + Float64(Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - Float64(x1 * Float64(6.0 - Float64(Float64(2.0 * Float64(Float64(x2 * -2.0) + Float64(3.0 - Float64(2.0 * x2)))) + Float64(x2 * 8.0)))))) * t_1)) - Float64(x1 * Float64(x1 * x1))) - x1) + Float64(3.0 * Float64(x1 - Float64(x2 * -2.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0))))))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = -1.0 - (x1 * x1); tmp = 0.0; if (x1 <= -4.8e+74) tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)); elseif (x1 <= 850.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5.4e+118) tmp = x1 - (((((t_0 * (((t_0 + (2.0 * x2)) - x1) / t_1)) + ((x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - (x1 * (6.0 - ((2.0 * ((x2 * -2.0) + (3.0 - (2.0 * x2)))) + (x2 * 8.0)))))) * t_1)) - (x1 * (x1 * x1))) - x1) + (3.0 * (x1 - (x2 * -2.0)))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.8e+74], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x1 * N[(12.0 + N[(x1 * 24.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 850.0], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], If[LessEqual[x1, 5.4e+118], N[(x1 - N[(N[(N[(N[(N[(t$95$0 * N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(6.0 - N[(N[(2.0 * N[(N[(x2 * -2.0), $MachinePrecision] + N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] + N[(3.0 * N[(x1 - N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := -1 - x1 \cdot x1\\
\mathbf{if}\;x1 \leq -4.8 \cdot 10^{+74}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x1 \cdot \left(12 + x1 \cdot 24\right)\right) - x1 \cdot \left(9 + x1 \cdot -19\right)\right) - -1\right)\\
\mathbf{elif}\;x1 \leq 850:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5.4 \cdot 10^{+118}:\\
\;\;\;\;x1 - \left(\left(\left(\left(t\_0 \cdot \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} + \left(x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - x1 \cdot \left(6 - \left(2 \cdot \left(x2 \cdot -2 + \left(3 - 2 \cdot x2\right)\right) + x2 \cdot 8\right)\right)\right)\right) \cdot t\_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right) + 3 \cdot \left(x1 - x2 \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -4.80000000000000017e74Initial program 10.0%
Simplified35.0%
Taylor expanded in x1 around 0 50.8%
Taylor expanded in x2 around 0 55.8%
if -4.80000000000000017e74 < x1 < 850Initial program 99.3%
Simplified88.1%
Taylor expanded in x1 around 0 76.1%
fma-define76.2%
metadata-eval76.2%
cancel-sign-sub-inv76.2%
associate-*r*76.2%
fmm-def76.2%
*-commutative76.2%
cancel-sign-sub-inv76.2%
metadata-eval76.2%
*-commutative76.2%
metadata-eval76.2%
Simplified76.2%
Taylor expanded in x2 around 0 87.2%
if 850 < x1 < 5.4e118Initial program 99.6%
Taylor expanded in x1 around 0 99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x1 around 0 52.1%
if 5.4e118 < x1 Initial program 18.2%
Simplified25.0%
Taylor expanded in x1 around 0 68.7%
Taylor expanded in x2 around 0 66.5%
Taylor expanded in x1 around 0 75.6%
Final simplification77.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -1.08e+79)
(-
(* x2 -6.0)
(*
x1
(-
(-
(* x2 (- 12.0 (* x1 (+ 12.0 (* x1 24.0)))))
(* x1 (+ 9.0 (* x1 -19.0))))
-1.0)))
(if (<= x1 5.2e+110)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+
(* x2 -6.0)
(* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.0))))))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.08e+79) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 5.2e+110) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.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.08d+79)) then
tmp = (x2 * (-6.0d0)) - (x1 * (((x2 * (12.0d0 - (x1 * (12.0d0 + (x1 * 24.0d0))))) - (x1 * (9.0d0 + (x1 * (-19.0d0))))) - (-1.0d0)))
else if (x1 <= 5.2d+110) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.0d0))))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.08e+79) {
tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0));
} else if (x1 <= 5.2e+110) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.08e+79: tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)) elif x1 <= 5.2e+110: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.08e+79) tmp = Float64(Float64(x2 * -6.0) - Float64(x1 * Float64(Float64(Float64(x2 * Float64(12.0 - Float64(x1 * Float64(12.0 + Float64(x1 * 24.0))))) - Float64(x1 * Float64(9.0 + Float64(x1 * -19.0)))) - -1.0))); elseif (x1 <= 5.2e+110) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0))))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.08e+79) tmp = (x2 * -6.0) - (x1 * (((x2 * (12.0 - (x1 * (12.0 + (x1 * 24.0))))) - (x1 * (9.0 + (x1 * -19.0)))) - -1.0)); elseif (x1 <= 5.2e+110) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.08e+79], N[(N[(x2 * -6.0), $MachinePrecision] - N[(x1 * N[(N[(N[(x2 * N[(12.0 - N[(x1 * N[(12.0 + N[(x1 * 24.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5.2e+110], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.08 \cdot 10^{+79}:\\
\;\;\;\;x2 \cdot -6 - x1 \cdot \left(\left(x2 \cdot \left(12 - x1 \cdot \left(12 + x1 \cdot 24\right)\right) - x1 \cdot \left(9 + x1 \cdot -19\right)\right) - -1\right)\\
\mathbf{elif}\;x1 \leq 5.2 \cdot 10^{+110}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\end{array}
\end{array}
if x1 < -1.08000000000000002e79Initial program 10.0%
Simplified35.0%
Taylor expanded in x1 around 0 50.8%
Taylor expanded in x2 around 0 55.8%
if -1.08000000000000002e79 < x1 < 5.2e110Initial program 99.3%
Simplified88.7%
Taylor expanded in x1 around 0 71.7%
fma-define71.8%
metadata-eval71.8%
cancel-sign-sub-inv71.8%
associate-*r*71.8%
fmm-def71.8%
*-commutative71.8%
cancel-sign-sub-inv71.8%
metadata-eval71.8%
*-commutative71.8%
metadata-eval71.8%
Simplified71.8%
Taylor expanded in x2 around 0 81.6%
if 5.2e110 < x1 Initial program 23.4%
Simplified29.8%
Taylor expanded in x1 around 0 64.7%
Taylor expanded in x2 around 0 62.6%
Taylor expanded in x1 around 0 71.1%
Final simplification75.7%
(FPCore (x1 x2) :precision binary64 (if (or (<= x1 -3.2e+33) (not (<= x1 1.3e+110))) (+ (* x2 -6.0) (* x1 (+ -1.0 (+ (* x2 -12.0) (* x1 (+ 9.0 (* x2 12.0))))))) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.2e+33) || !(x1 <= 1.3e+110)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x1 <= (-3.2d+33)) .or. (.not. (x1 <= 1.3d+110))) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + ((x2 * (-12.0d0)) + (x1 * (9.0d0 + (x2 * 12.0d0))))))
else
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x1 <= -3.2e+33) || !(x1 <= 1.3e+110)) {
tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0))))));
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x1 <= -3.2e+33) or not (x1 <= 1.3e+110): tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))) else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x1 <= -3.2e+33) || !(x1 <= 1.3e+110)) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(Float64(x2 * -12.0) + Float64(x1 * Float64(9.0 + Float64(x2 * 12.0))))))); else tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x1 <= -3.2e+33) || ~((x1 <= 1.3e+110))) tmp = (x2 * -6.0) + (x1 * (-1.0 + ((x2 * -12.0) + (x1 * (9.0 + (x2 * 12.0)))))); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x1, -3.2e+33], N[Not[LessEqual[x1, 1.3e+110]], $MachinePrecision]], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(N[(x2 * -12.0), $MachinePrecision] + N[(x1 * N[(9.0 + N[(x2 * 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.2 \cdot 10^{+33} \lor \neg \left(x1 \leq 1.3 \cdot 10^{+110}\right):\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + \left(x2 \cdot -12 + x1 \cdot \left(9 + x2 \cdot 12\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\end{array}
\end{array}
if x1 < -3.20000000000000017e33 or 1.3e110 < x1 Initial program 27.1%
Simplified40.3%
Taylor expanded in x1 around 0 47.7%
Taylor expanded in x2 around 0 50.8%
Taylor expanded in x1 around 0 55.8%
if -3.20000000000000017e33 < x1 < 1.3e110Initial program 99.3%
Simplified87.9%
Taylor expanded in x1 around 0 75.1%
fma-define75.2%
metadata-eval75.2%
cancel-sign-sub-inv75.2%
associate-*r*75.2%
fmm-def75.2%
*-commutative75.2%
cancel-sign-sub-inv75.2%
metadata-eval75.2%
*-commutative75.2%
metadata-eval75.2%
Simplified75.2%
Taylor expanded in x2 around 0 85.7%
Final simplification74.2%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -4.9e+48) (* x2 (- (- (* x1 -12.0) (/ x1 x2)) 6.0)) (- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.9e+48) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.9d+48)) then
tmp = x2 * (((x1 * (-12.0d0)) - (x1 / x2)) - 6.0d0)
else
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.9e+48) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.9e+48: tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0) else: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.9e+48) tmp = Float64(x2 * Float64(Float64(Float64(x1 * -12.0) - Float64(x1 / x2)) - 6.0)); else tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.9e+48) tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0); else tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.9e+48], N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] - N[(x1 / x2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] + N[(8.0 * N[(x1 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.9 \cdot 10^{+48}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 - \frac{x1}{x2}\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\end{array}
\end{array}
if x1 < -4.9000000000000003e48Initial program 23.2%
Simplified44.5%
Taylor expanded in x1 around 0 4.5%
fma-define4.5%
metadata-eval4.5%
cancel-sign-sub-inv4.5%
associate-*r*4.5%
fmm-def4.5%
*-commutative4.5%
cancel-sign-sub-inv4.5%
metadata-eval4.5%
*-commutative4.5%
metadata-eval4.5%
Simplified4.5%
Taylor expanded in x2 around 0 17.6%
Taylor expanded in x2 around inf 35.6%
if -4.9000000000000003e48 < x1 Initial program 82.3%
Simplified75.1%
Taylor expanded in x1 around 0 65.2%
fma-define65.3%
metadata-eval65.3%
cancel-sign-sub-inv65.3%
associate-*r*65.3%
fmm-def65.3%
*-commutative65.3%
cancel-sign-sub-inv65.3%
metadata-eval65.3%
*-commutative65.3%
metadata-eval65.3%
Simplified65.3%
Taylor expanded in x2 around 0 73.2%
Final simplification66.3%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -4.9e+48) (* x2 (- (- (* x1 -12.0) (/ x1 x2)) 6.0)) (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 (- (* x2 8.0) 12.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.9e+48) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.9d+48)) then
tmp = x2 * (((x1 * (-12.0d0)) - (x1 / x2)) - 6.0d0)
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * ((x2 * 8.0d0) - 12.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.9e+48) {
tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.9e+48: tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.9e+48) tmp = Float64(x2 * Float64(Float64(Float64(x1 * -12.0) - Float64(x1 / x2)) - 6.0)); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * Float64(Float64(x2 * 8.0) - 12.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.9e+48) tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * ((x2 * 8.0) - 12.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.9e+48], N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] - N[(x1 / x2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * N[(N[(x2 * 8.0), $MachinePrecision] - 12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.9 \cdot 10^{+48}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 - \frac{x1}{x2}\right) - 6\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot \left(x2 \cdot 8 - 12\right)\right)\\
\end{array}
\end{array}
if x1 < -4.9000000000000003e48Initial program 23.2%
Simplified44.5%
Taylor expanded in x1 around 0 4.5%
fma-define4.5%
metadata-eval4.5%
cancel-sign-sub-inv4.5%
associate-*r*4.5%
fmm-def4.5%
*-commutative4.5%
cancel-sign-sub-inv4.5%
metadata-eval4.5%
*-commutative4.5%
metadata-eval4.5%
Simplified4.5%
Taylor expanded in x2 around 0 17.6%
Taylor expanded in x2 around inf 35.6%
if -4.9000000000000003e48 < x1 Initial program 82.3%
Simplified75.1%
Taylor expanded in x1 around 0 65.2%
Taylor expanded in x2 around 0 65.2%
Final simplification59.8%
(FPCore (x1 x2) :precision binary64 (* x2 (- (- (* x1 -12.0) (/ x1 x2)) 6.0)))
double code(double x1, double x2) {
return x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (((x1 * (-12.0d0)) - (x1 / x2)) - 6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0);
}
def code(x1, x2): return x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0)
function code(x1, x2) return Float64(x2 * Float64(Float64(Float64(x1 * -12.0) - Float64(x1 / x2)) - 6.0)) end
function tmp = code(x1, x2) tmp = x2 * (((x1 * -12.0) - (x1 / x2)) - 6.0); end
code[x1_, x2_] := N[(x2 * N[(N[(N[(x1 * -12.0), $MachinePrecision] - N[(x1 / x2), $MachinePrecision]), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(\left(x1 \cdot -12 - \frac{x1}{x2}\right) - 6\right)
\end{array}
Initial program 71.4%
Simplified69.5%
Taylor expanded in x1 around 0 54.1%
fma-define54.1%
metadata-eval54.1%
cancel-sign-sub-inv54.1%
associate-*r*54.1%
fmm-def54.1%
*-commutative54.1%
cancel-sign-sub-inv54.1%
metadata-eval54.1%
*-commutative54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x2 around 0 42.8%
Taylor expanded in x2 around inf 46.1%
Final simplification46.1%
(FPCore (x1 x2) :precision binary64 (+ (* x2 -6.0) (* x1 (+ -1.0 (* x2 -12.0)))))
double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x2 * (-12.0d0))))
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)));
}
def code(x1, x2): return (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0)))
function code(x1, x2) return Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x2 * -12.0)))) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) + (x1 * (-1.0 + (x2 * -12.0))); end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x2 * -12.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 + x1 \cdot \left(-1 + x2 \cdot -12\right)
\end{array}
Initial program 71.4%
Simplified69.5%
Taylor expanded in x1 around 0 54.1%
fma-define54.1%
metadata-eval54.1%
cancel-sign-sub-inv54.1%
associate-*r*54.1%
fmm-def54.1%
*-commutative54.1%
cancel-sign-sub-inv54.1%
metadata-eval54.1%
*-commutative54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x2 around 0 42.8%
Taylor expanded in x1 around 0 42.8%
Final simplification42.8%
(FPCore (x1 x2) :precision binary64 (- (* x2 (- (* x1 -12.0) 6.0)) x1))
double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * ((x1 * (-12.0d0)) - 6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * ((x1 * -12.0) - 6.0)) - x1;
}
def code(x1, x2): return (x2 * ((x1 * -12.0) - 6.0)) - x1
function code(x1, x2) return Float64(Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0)) - x1) end
function tmp = code(x1, x2) tmp = (x2 * ((x1 * -12.0) - 6.0)) - x1; end
code[x1_, x2_] := N[(N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot \left(x1 \cdot -12 - 6\right) - x1
\end{array}
Initial program 71.4%
Simplified69.5%
Taylor expanded in x1 around 0 54.1%
fma-define54.1%
metadata-eval54.1%
cancel-sign-sub-inv54.1%
associate-*r*54.1%
fmm-def54.1%
*-commutative54.1%
cancel-sign-sub-inv54.1%
metadata-eval54.1%
*-commutative54.1%
metadata-eval54.1%
Simplified54.1%
Taylor expanded in x2 around 0 42.8%
pow142.8%
mul-1-neg42.8%
Applied egg-rr42.8%
unpow142.8%
Simplified42.8%
Taylor expanded in x2 around 0 42.8%
Final simplification42.8%
herbie shell --seed 2024179
(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))))))