
(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 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
double t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
double tmp;
if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))) tmp = 0 if t_3 <= math.inf: tmp = t_3 else: tmp = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) t_3 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(Float64(x1 * 2.0) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(t_2 * 4.0) - 6.0)))) + Float64(t_0 * t_2)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) tmp = 0.0 if (t_3 <= Inf) tmp = t_3; else tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; t_3 = x1 + ((x1 + (((t_1 * ((((x1 * 2.0) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((t_2 * 4.0) - 6.0)))) + (t_0 * t_2)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); tmp = 0.0; if (t_3 <= Inf) tmp = t_3; else tmp = x1 + (x1 + (6.0 * (x1 ^ 4.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$2 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, Infinity], t$95$3, N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $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}\\
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 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\end{array}
\end{array}
if (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) < +inf.0Initial program 99.6%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 2 x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)) 3)) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 4 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))) 6))) (+.f64 (*.f64 x1 x1) 1)) (*.f64 (*.f64 (*.f64 3 x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1)))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 3 (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 3 x1) x1) (*.f64 2 x2)) x1) (+.f64 (*.f64 x1 x1) 1))))) Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around inf 10.3%
*-commutative10.3%
Simplified10.3%
Taylor expanded in x1 around inf 100.0%
Final simplification99.7%
(FPCore (x1 x2)
:precision binary64
(if (or (<= x1 -380.0) (not (<= x1 6100000.0)))
(+ x1 (+ x1 (* 6.0 (pow x1 4.0))))
(+
x1
(+
(+ x1 (* 4.0 (* x2 (* x1 (fma x2 2.0 -3.0)))))
(* 3.0 (- (* x2 -2.0) x1))))))
double code(double x1, double x2) {
double tmp;
if ((x1 <= -380.0) || !(x1 <= 6100000.0)) {
tmp = x1 + (x1 + (6.0 * pow(x1, 4.0)));
} else {
tmp = x1 + ((x1 + (4.0 * (x2 * (x1 * fma(x2, 2.0, -3.0))))) + (3.0 * ((x2 * -2.0) - x1)));
}
return tmp;
}
function code(x1, x2) tmp = 0.0 if ((x1 <= -380.0) || !(x1 <= 6100000.0)) tmp = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))); else tmp = Float64(x1 + Float64(Float64(x1 + Float64(4.0 * Float64(x2 * Float64(x1 * fma(x2, 2.0, -3.0))))) + Float64(3.0 * Float64(Float64(x2 * -2.0) - x1)))); end return tmp end
code[x1_, x2_] := If[Or[LessEqual[x1, -380.0], N[Not[LessEqual[x1, 6100000.0]], $MachinePrecision]], N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x1 + N[(4.0 * N[(x2 * N[(x1 * N[(x2 * 2.0 + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(x2 * -2.0), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -380 \lor \neg \left(x1 \leq 6100000\right):\\
\;\;\;\;x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(\left(x1 + 4 \cdot \left(x2 \cdot \left(x1 \cdot \mathsf{fma}\left(x2, 2, -3\right)\right)\right)\right) + 3 \cdot \left(x2 \cdot -2 - x1\right)\right)\\
\end{array}
\end{array}
if x1 < -380 or 6.1e6 < x1 Initial program 33.5%
Taylor expanded in x1 around inf 30.4%
*-commutative30.4%
Simplified30.4%
Taylor expanded in x1 around inf 32.8%
*-commutative32.8%
Simplified32.8%
Taylor expanded in x1 around inf 92.3%
if -380 < x1 < 6.1e6Initial program 99.5%
Taylor expanded in x1 around inf 98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in x1 around 0 82.9%
Taylor expanded in x1 around 0 82.3%
mul-1-neg82.3%
unsub-neg82.3%
*-commutative82.3%
Simplified82.3%
pow182.3%
associate-*r*97.4%
fma-neg97.4%
metadata-eval97.4%
Applied egg-rr97.4%
unpow197.4%
*-commutative97.4%
metadata-eval97.4%
fma-neg97.4%
associate-*l*97.4%
*-commutative97.4%
fma-neg97.4%
metadata-eval97.4%
Simplified97.4%
Final simplification94.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (+ x1 (+ x1 (* 6.0 (pow x1 4.0)))))
(t_2 (* x1 (* x1 3.0)))
(t_3 (/ (- (+ t_2 (* 2.0 x2)) x1) t_0))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_2 (* 2.0 x2)) x1) t_0))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_2 t_3)
(*
t_0
(+
(* (* x1 x1) (- (* t_3 4.0) 6.0))
(* 4.0 (* x1 (* x2 (- (* 2.0 x2) 3.0)))))))))))))
(if (<= x1 -3.05e+62)
t_1
(if (<= x1 -2.3e-182)
t_4
(if (<= x1 1.6e-187)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 2e+74) t_4 t_1))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * pow(x1, 4.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
double tmp;
if (x1 <= -3.05e+62) {
tmp = t_1;
} else if (x1 <= -2.3e-182) {
tmp = t_4;
} else if (x1 <= 1.6e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+74) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 + (x1 + (6.0d0 * (x1 ** 4.0d0)))
t_2 = x1 * (x1 * 3.0d0)
t_3 = ((t_2 + (2.0d0 * x2)) - x1) / t_0
t_4 = x1 + ((3.0d0 * (((t_2 - (2.0d0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * (x2 * ((2.0d0 * x2) - 3.0d0))))))))))
if (x1 <= (-3.05d+62)) then
tmp = t_1
else if (x1 <= (-2.3d-182)) then
tmp = t_4
else if (x1 <= 1.6d-187) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+74) then
tmp = t_4
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 + (x1 + (6.0 * Math.pow(x1, 4.0)));
double t_2 = x1 * (x1 * 3.0);
double t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0;
double t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0))))))))));
double tmp;
if (x1 <= -3.05e+62) {
tmp = t_1;
} else if (x1 <= -2.3e-182) {
tmp = t_4;
} else if (x1 <= 1.6e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+74) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 + (x1 + (6.0 * math.pow(x1, 4.0))) t_2 = x1 * (x1 * 3.0) t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0 t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))) tmp = 0 if x1 <= -3.05e+62: tmp = t_1 elif x1 <= -2.3e-182: tmp = t_4 elif x1 <= 1.6e-187: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 2e+74: tmp = t_4 else: tmp = t_1 return tmp
function code(x1, x2) t_0 = Float64(Float64(x1 * x1) + 1.0) t_1 = Float64(x1 + Float64(x1 + Float64(6.0 * (x1 ^ 4.0)))) t_2 = Float64(x1 * Float64(x1 * 3.0)) t_3 = Float64(Float64(Float64(t_2 + Float64(2.0 * x2)) - x1) / t_0) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_2 - Float64(2.0 * x2)) - x1) / t_0)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_2 * t_3) + Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))))))))))) tmp = 0.0 if (x1 <= -3.05e+62) tmp = t_1; elseif (x1 <= -2.3e-182) tmp = t_4; elseif (x1 <= 1.6e-187) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 2e+74) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x1, x2) t_0 = (x1 * x1) + 1.0; t_1 = x1 + (x1 + (6.0 * (x1 ^ 4.0))); t_2 = x1 * (x1 * 3.0); t_3 = ((t_2 + (2.0 * x2)) - x1) / t_0; t_4 = x1 + ((3.0 * (((t_2 - (2.0 * x2)) - x1) / t_0)) + (x1 + ((x1 * (x1 * x1)) + ((t_2 * t_3) + (t_0 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * (x2 * ((2.0 * x2) - 3.0)))))))))); tmp = 0.0; if (x1 <= -3.05e+62) tmp = t_1; elseif (x1 <= -2.3e-182) tmp = t_4; elseif (x1 <= 1.6e-187) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 2e+74) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(x1 + N[(6.0 * N[Power[x1, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$2 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * t$95$3), $MachinePrecision] + N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.05e+62], t$95$1, If[LessEqual[x1, -2.3e-182], t$95$4, If[LessEqual[x1, 1.6e-187], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+74], t$95$4, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot x1 + 1\\
t_1 := x1 + \left(x1 + 6 \cdot {x1}^{4}\right)\\
t_2 := x1 \cdot \left(x1 \cdot 3\right)\\
t_3 := \frac{\left(t\_2 + 2 \cdot x2\right) - x1}{t\_0}\\
t_4 := x1 + \left(3 \cdot \frac{\left(t\_2 - 2 \cdot x2\right) - x1}{t\_0} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_2 \cdot t\_3 + t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -3.05 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -2.3 \cdot 10^{-182}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.6 \cdot 10^{-187}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+74}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x1 < -3.0499999999999998e62 or 1.9999999999999999e74 < x1 Initial program 22.3%
Taylor expanded in x1 around inf 20.5%
*-commutative20.5%
Simplified20.5%
Taylor expanded in x1 around inf 28.6%
*-commutative28.6%
Simplified28.6%
Taylor expanded in x1 around inf 98.2%
if -3.0499999999999998e62 < x1 < -2.2999999999999999e-182 or 1.5999999999999999e-187 < x1 < 1.9999999999999999e74Initial program 99.4%
Taylor expanded in x1 around 0 89.5%
if -2.2999999999999999e-182 < x1 < 1.5999999999999999e-187Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
Final simplification92.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* x1 (* x1 3.0)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (+ t_1 (* 2.0 x2)) x1) t_2))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_1 t_3)
(*
t_2
(+ (* (* x1 x1) (- (* t_3 4.0) 6.0)) (* 4.0 (* x1 t_0)))))))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -9.8e-182)
t_4
(if (<= x1 3e-186)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 1.35e+154) t_4 (+ x1 (* x1 (+ 1.0 (* 4.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * t_0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -9.8e-182) {
tmp = t_4;
} else if (x1 <= 3e-186) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = x1 * (x1 * 3.0d0)
t_2 = (x1 * x1) + 1.0d0
t_3 = ((t_1 + (2.0d0 * x2)) - x1) / t_2
t_4 = x1 + ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0d0) - 6.0d0)) + (4.0d0 * (x1 * t_0))))))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-9.8d-182)) then
tmp = t_4
else if (x1 <= 3d-186) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 1.35d+154) then
tmp = t_4
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = x1 * (x1 * 3.0);
double t_2 = (x1 * x1) + 1.0;
double t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2;
double t_4 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * t_0))))))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -9.8e-182) {
tmp = t_4;
} else if (x1 <= 3e-186) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 1.35e+154) {
tmp = t_4;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_0)));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = x1 * (x1 * 3.0) t_2 = (x1 * x1) + 1.0 t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2 t_4 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * t_0)))))))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -9.8e-182: tmp = t_4 elif x1 <= 3e-186: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 1.35e+154: tmp = t_4 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_0))) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(x1 * Float64(x1 * 3.0)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(Float64(t_1 + Float64(2.0 * x2)) - x1) / t_2) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * t_3) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_3 * 4.0) - 6.0)) + Float64(4.0 * Float64(x1 * t_0))))))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -9.8e-182) tmp = t_4; elseif (x1 <= 3e-186) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = x1 * (x1 * 3.0); t_2 = (x1 * x1) + 1.0; t_3 = ((t_1 + (2.0 * x2)) - x1) / t_2; t_4 = x1 + ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_1 * t_3) + (t_2 * (((x1 * x1) * ((t_3 * 4.0) - 6.0)) + (4.0 * (x1 * t_0)))))))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -9.8e-182) tmp = t_4; elseif (x1 <= 3e-186) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 1.35e+154) tmp = t_4; else tmp = x1 + (x1 * (1.0 + (4.0 * t_0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * t$95$3), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$3 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -9.8e-182], t$95$4, If[LessEqual[x1, 3e-186], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], t$95$4, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := x1 \cdot \left(x1 \cdot 3\right)\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\left(t\_1 + 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 + \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot t\_3 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_3 \cdot 4 - 6\right) + 4 \cdot \left(x1 \cdot t\_0\right)\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -9.8 \cdot 10^{-182}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 3 \cdot 10^{-186}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_0\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 6.0%
mul-1-neg6.0%
unsub-neg6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in x2 around 0 17.5%
if -5.60000000000000037e102 < x1 < -9.8000000000000006e-182 or 3.0000000000000001e-186 < x1 < 1.35000000000000003e154Initial program 99.5%
Taylor expanded in x1 around 0 89.2%
if -9.8000000000000006e-182 < x1 < 3.0000000000000001e-186Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 38.9%
Final simplification66.9%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2
(+
x1
(+
(+
x1
(+
(* x1 (* x1 x1))
(+
(*
t_1
(+
(* (* x1 x1) (- (* (/ (- (+ t_0 (* 2.0 x2)) x1) t_1) 4.0) 6.0))
-6.0))
(* 3.0 t_0))))
(* 3.0 (* x2 -2.0)))))
(t_3 (* x2 (- (* 2.0 x2) 3.0)))
(t_4
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(+ x1 (* 4.0 (* x1 t_3)))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -2750.0)
t_2
(if (<= x1 -2.35e-182)
t_4
(if (<= x1 1.7e-186)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 190000.0)
t_4
(if (<= x1 1.35e+154)
t_2
(+ x1 (* x1 (+ 1.0 (* 4.0 t_3))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + -6.0)) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
double t_3 = x2 * ((2.0 * x2) - 3.0);
double t_4 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * t_3))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2750.0) {
tmp = t_2;
} else if (x1 <= -2.35e-182) {
tmp = t_4;
} else if (x1 <= 1.7e-186) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 190000.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_2;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_3)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0d0 * x2)) - x1) / t_1) * 4.0d0) - 6.0d0)) + (-6.0d0))) + (3.0d0 * t_0)))) + (3.0d0 * (x2 * (-2.0d0))))
t_3 = x2 * ((2.0d0 * x2) - 3.0d0)
t_4 = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) + (x1 + (4.0d0 * (x1 * t_3))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-2750.0d0)) then
tmp = t_2
else if (x1 <= (-2.35d-182)) then
tmp = t_4
else if (x1 <= 1.7d-186) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 190000.0d0) then
tmp = t_4
else if (x1 <= 1.35d+154) then
tmp = t_2
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_3)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + -6.0)) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0)));
double t_3 = x2 * ((2.0 * x2) - 3.0);
double t_4 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * t_3))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2750.0) {
tmp = t_2;
} else if (x1 <= -2.35e-182) {
tmp = t_4;
} else if (x1 <= 1.7e-186) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 190000.0) {
tmp = t_4;
} else if (x1 <= 1.35e+154) {
tmp = t_2;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_3)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + -6.0)) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0))) t_3 = x2 * ((2.0 * x2) - 3.0) t_4 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * t_3)))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -2750.0: tmp = t_2 elif x1 <= -2.35e-182: tmp = t_4 elif x1 <= 1.7e-186: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 190000.0: tmp = t_4 elif x1 <= 1.35e+154: tmp = t_2 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_3))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + -6.0)) + Float64(3.0 * t_0)))) + Float64(3.0 * Float64(x2 * -2.0)))) t_3 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_4 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) + Float64(x1 + Float64(4.0 * Float64(x1 * t_3))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -2750.0) tmp = t_2; elseif (x1 <= -2.35e-182) tmp = t_4; elseif (x1 <= 1.7e-186) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 190000.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_2; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_3)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = x1 + ((x1 + ((x1 * (x1 * x1)) + ((t_1 * (((x1 * x1) * (((((t_0 + (2.0 * x2)) - x1) / t_1) * 4.0) - 6.0)) + -6.0)) + (3.0 * t_0)))) + (3.0 * (x2 * -2.0))); t_3 = x2 * ((2.0 * x2) - 3.0); t_4 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) + (x1 + (4.0 * (x1 * t_3)))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -2750.0) tmp = t_2; elseif (x1 <= -2.35e-182) tmp = t_4; elseif (x1 <= 1.7e-186) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 190000.0) tmp = t_4; elseif (x1 <= 1.35e+154) tmp = t_2; else tmp = x1 + (x1 * (1.0 + (4.0 * t_3))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(x1 + N[(N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision] * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision] + N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(x2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(4.0 * N[(x1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2750.0], t$95$2, If[LessEqual[x1, -2.35e-182], t$95$4, If[LessEqual[x1, 1.7e-186], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 190000.0], t$95$4, If[LessEqual[x1, 1.35e+154], t$95$2, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$3), $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 := x1 + \left(\left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(\frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1} \cdot 4 - 6\right) + -6\right) + 3 \cdot t\_0\right)\right)\right) + 3 \cdot \left(x2 \cdot -2\right)\right)\\
t_3 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_4 := x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} + \left(x1 + 4 \cdot \left(x1 \cdot t\_3\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2750:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x1 \leq -2.35 \cdot 10^{-182}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.7 \cdot 10^{-186}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 190000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_3\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 6.0%
mul-1-neg6.0%
unsub-neg6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in x2 around 0 17.5%
if -5.60000000000000037e102 < x1 < -2750 or 1.9e5 < x1 < 1.35000000000000003e154Initial program 99.6%
Taylor expanded in x1 around inf 90.9%
Taylor expanded in x1 around inf 90.9%
Taylor expanded in x1 around 0 90.9%
*-commutative90.9%
Simplified90.9%
if -2750 < x1 < -2.35e-182 or 1.7e-186 < x1 < 1.9e5Initial program 99.4%
Taylor expanded in x1 around inf 97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in x1 around 0 92.6%
if -2.35e-182 < x1 < 1.7e-186Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 38.9%
Final simplification68.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1)))
(t_3
(+
x1
(+
t_2
(+
x1
(+
(* x1 (* x1 x1))
(+ (* 3.0 t_0) (* t_1 (+ -6.0 (* (* x1 x1) 6.0)))))))))
(t_4 (* x2 (- (* 2.0 x2) 3.0)))
(t_5 (+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 t_4)))))))
(if (<= x1 -5.6e+102)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -550.0)
t_3
(if (<= x1 -3.2e-182)
t_5
(if (<= x1 8.8e-188)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 5800000.0)
t_5
(if (<= x1 1.35e+154)
t_3
(+ x1 (* x1 (+ 1.0 (* 4.0 t_4))))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (-6.0 + ((x1 * x1) * 6.0)))))));
double t_4 = x2 * ((2.0 * x2) - 3.0);
double t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -550.0) {
tmp = t_3;
} else if (x1 <= -3.2e-182) {
tmp = t_5;
} else if (x1 <= 8.8e-188) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 5800000.0) {
tmp = t_5;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_4)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (x1 * x1) + 1.0d0
t_2 = 3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)
t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0d0 * t_0) + (t_1 * ((-6.0d0) + ((x1 * x1) * 6.0d0)))))))
t_4 = x2 * ((2.0d0 * x2) - 3.0d0)
t_5 = x1 + (t_2 + (x1 + (4.0d0 * (x1 * t_4))))
if (x1 <= (-5.6d+102)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-550.0d0)) then
tmp = t_3
else if (x1 <= (-3.2d-182)) then
tmp = t_5
else if (x1 <= 8.8d-188) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 5800000.0d0) then
tmp = t_5
else if (x1 <= 1.35d+154) then
tmp = t_3
else
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * t_4)))
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 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1);
double t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (-6.0 + ((x1 * x1) * 6.0)))))));
double t_4 = x2 * ((2.0 * x2) - 3.0);
double t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4))));
double tmp;
if (x1 <= -5.6e+102) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -550.0) {
tmp = t_3;
} else if (x1 <= -3.2e-182) {
tmp = t_5;
} else if (x1 <= 8.8e-188) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 5800000.0) {
tmp = t_5;
} else if (x1 <= 1.35e+154) {
tmp = t_3;
} else {
tmp = x1 + (x1 * (1.0 + (4.0 * t_4)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1) t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (-6.0 + ((x1 * x1) * 6.0))))))) t_4 = x2 * ((2.0 * x2) - 3.0) t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4)))) tmp = 0 if x1 <= -5.6e+102: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -550.0: tmp = t_3 elif x1 <= -3.2e-182: tmp = t_5 elif x1 <= 8.8e-188: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 5800000.0: tmp = t_5 elif x1 <= 1.35e+154: tmp = t_3 else: tmp = x1 + (x1 * (1.0 + (4.0 * t_4))) 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(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) t_3 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(3.0 * t_0) + Float64(t_1 * Float64(-6.0 + Float64(Float64(x1 * x1) * 6.0)))))))) t_4 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_5 = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * t_4))))) tmp = 0.0 if (x1 <= -5.6e+102) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -550.0) tmp = t_3; elseif (x1 <= -3.2e-182) tmp = t_5; elseif (x1 <= 8.8e-188) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 5800000.0) tmp = t_5; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * t_4)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; t_2 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1); t_3 = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + ((3.0 * t_0) + (t_1 * (-6.0 + ((x1 * x1) * 6.0))))))); t_4 = x2 * ((2.0 * x2) - 3.0); t_5 = x1 + (t_2 + (x1 + (4.0 * (x1 * t_4)))); tmp = 0.0; if (x1 <= -5.6e+102) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -550.0) tmp = t_3; elseif (x1 <= -3.2e-182) tmp = t_5; elseif (x1 <= 8.8e-188) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 5800000.0) tmp = t_5; elseif (x1 <= 1.35e+154) tmp = t_3; else tmp = x1 + (x1 * (1.0 + (4.0 * t_4))); 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[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(-6.0 + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.6e+102], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -550.0], t$95$3, If[LessEqual[x1, -3.2e-182], t$95$5, If[LessEqual[x1, 8.8e-188], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5800000.0], t$95$5, If[LessEqual[x1, 1.35e+154], t$95$3, N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * t$95$4), $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 := 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\\
t_3 := x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(3 \cdot t\_0 + t\_1 \cdot \left(-6 + \left(x1 \cdot x1\right) \cdot 6\right)\right)\right)\right)\right)\\
t_4 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_5 := x1 + \left(t\_2 + \left(x1 + 4 \cdot \left(x1 \cdot t\_4\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -550:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq -3.2 \cdot 10^{-182}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 8.8 \cdot 10^{-188}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 5800000:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot t\_4\right)\\
\end{array}
\end{array}
if x1 < -5.60000000000000037e102Initial program 2.1%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 2.2%
Taylor expanded in x1 around 0 6.0%
mul-1-neg6.0%
unsub-neg6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in x2 around 0 17.5%
if -5.60000000000000037e102 < x1 < -550 or 5.8e6 < x1 < 1.35000000000000003e154Initial program 99.6%
Taylor expanded in x1 around inf 90.9%
Taylor expanded in x1 around inf 90.9%
Taylor expanded in x1 around inf 79.0%
if -550 < x1 < -3.20000000000000002e-182 or 8.7999999999999998e-188 < x1 < 5.8e6Initial program 99.4%
Taylor expanded in x1 around inf 97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in x1 around 0 92.6%
if -3.20000000000000002e-182 < x1 < 8.7999999999999998e-188Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 38.9%
Final simplification66.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0))))
(t_1 (+ x1 (+ (* x2 -6.0) (* x1 (- t_0 2.0))))))
(if (<= x1 -4.1e+52)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -2.3e-182)
t_1
(if (<= x1 2.05e-187)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 2e+80)
t_1
(if (<= x1 1.35e+154)
(+
x1
(+
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(+ x1 (+ (* x1 (* x1 x1)) -6.0))))
(+ x1 (* x1 (+ 1.0 t_0))))))))))
double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double t_1 = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0)));
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2.3e-182) {
tmp = t_1;
} else if (x1 <= 2.05e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+80) {
tmp = t_1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + -6.0)));
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))
t_1 = x1 + ((x2 * (-6.0d0)) + (x1 * (t_0 - 2.0d0)))
if (x1 <= (-4.1d+52)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-2.3d-182)) then
tmp = t_1
else if (x1 <= 2.05d-187) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+80) then
tmp = t_1
else if (x1 <= 1.35d+154) then
tmp = x1 + ((3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) + (x1 + ((x1 * (x1 * x1)) + (-6.0d0))))
else
tmp = x1 + (x1 * (1.0d0 + t_0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0));
double t_1 = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0)));
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2.3e-182) {
tmp = t_1;
} else if (x1 <= 2.05e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+80) {
tmp = t_1;
} else if (x1 <= 1.35e+154) {
tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + -6.0)));
} else {
tmp = x1 + (x1 * (1.0 + t_0));
}
return tmp;
}
def code(x1, x2): t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)) t_1 = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))) tmp = 0 if x1 <= -4.1e+52: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -2.3e-182: tmp = t_1 elif x1 <= 2.05e-187: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 2e+80: tmp = t_1 elif x1 <= 1.35e+154: tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + -6.0))) else: tmp = x1 + (x1 * (1.0 + t_0)) return tmp
function code(x1, x2) t_0 = Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) t_1 = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_0 - 2.0)))) tmp = 0.0 if (x1 <= -4.1e+52) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -2.3e-182) tmp = t_1; elseif (x1 <= 2.05e-187) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 2e+80) tmp = t_1; elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + -6.0)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_0))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = 4.0 * (x2 * ((2.0 * x2) - 3.0)); t_1 = x1 + ((x2 * -6.0) + (x1 * (t_0 - 2.0))); tmp = 0.0; if (x1 <= -4.1e+52) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -2.3e-182) tmp = t_1; elseif (x1 <= 2.05e-187) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 2e+80) tmp = t_1; elseif (x1 <= 1.35e+154) tmp = x1 + ((3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) + (x1 + ((x1 * (x1 * x1)) + -6.0))); else tmp = x1 + (x1 * (1.0 + t_0)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$0 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.1e+52], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.3e-182], t$95$1, If[LessEqual[x1, 2.05e-187], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+80], t$95$1, If[LessEqual[x1, 1.35e+154], N[(x1 + N[(N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\\
t_1 := x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_0 - 2\right)\right)\\
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.3 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 2.05 \cdot 10^{-187}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + -6\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_0\right)\\
\end{array}
\end{array}
if x1 < -4.1e52Initial program 20.7%
Taylor expanded in x1 around inf 15.7%
*-commutative15.7%
Simplified15.7%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.6%
mul-1-neg5.6%
unsub-neg5.6%
*-commutative5.6%
Simplified5.6%
Taylor expanded in x2 around 0 15.0%
if -4.1e52 < x1 < -2.2999999999999999e-182 or 2.0500000000000001e-187 < x1 < 2e80Initial program 99.3%
Taylor expanded in x1 around inf 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in x1 around 0 79.5%
Taylor expanded in x1 around 0 79.0%
if -2.2999999999999999e-182 < x1 < 2.0500000000000001e-187Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
if 2e80 < x1 < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around 0 35.7%
Taylor expanded in x1 around 0 74.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 38.9%
Final simplification58.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x2 (- (* 2.0 x2) 3.0)))
(t_1 (* 4.0 t_0))
(t_2
(*
3.0
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))))
(if (<= x1 -4.1e+52)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (<= x1 -2.7e-182)
(+ x1 (+ (* x2 -6.0) (* x1 (- t_1 2.0))))
(if (<= x1 6e-187)
(+ x1 (+ (* x2 -6.0) (* x1 -2.0)))
(if (<= x1 2e+80)
(+ x1 (+ t_2 (+ x1 (* 4.0 (* x1 t_0)))))
(if (<= x1 1.35e+154)
(+ x1 (+ t_2 (+ x1 (+ (* x1 (* x1 x1)) -6.0))))
(+ x1 (* x1 (+ 1.0 t_1))))))))))
double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = 4.0 * t_0;
double t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2.7e-182) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 6e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+80) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + -6.0)));
} else {
tmp = x1 + (x1 * (1.0 + 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) :: tmp
t_0 = x2 * ((2.0d0 * x2) - 3.0d0)
t_1 = 4.0d0 * t_0
t_2 = 3.0d0 * ((((x1 * (x1 * 3.0d0)) - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))
if (x1 <= (-4.1d+52)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if (x1 <= (-2.7d-182)) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (t_1 - 2.0d0)))
else if (x1 <= 6d-187) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
else if (x1 <= 2d+80) then
tmp = x1 + (t_2 + (x1 + (4.0d0 * (x1 * t_0))))
else if (x1 <= 1.35d+154) then
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + (-6.0d0))))
else
tmp = x1 + (x1 * (1.0d0 + t_1))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x2 * ((2.0 * x2) - 3.0);
double t_1 = 4.0 * t_0;
double t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0));
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if (x1 <= -2.7e-182) {
tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0)));
} else if (x1 <= 6e-187) {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
} else if (x1 <= 2e+80) {
tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_0))));
} else if (x1 <= 1.35e+154) {
tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + -6.0)));
} else {
tmp = x1 + (x1 * (1.0 + t_1));
}
return tmp;
}
def code(x1, x2): t_0 = x2 * ((2.0 * x2) - 3.0) t_1 = 4.0 * t_0 t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) tmp = 0 if x1 <= -4.1e+52: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif x1 <= -2.7e-182: tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))) elif x1 <= 6e-187: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) elif x1 <= 2e+80: tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_0)))) elif x1 <= 1.35e+154: tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + -6.0))) else: tmp = x1 + (x1 * (1.0 + t_1)) return tmp
function code(x1, x2) t_0 = Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)) t_1 = Float64(4.0 * t_0) t_2 = Float64(3.0 * Float64(Float64(Float64(Float64(x1 * Float64(x1 * 3.0)) - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) tmp = 0.0 if (x1 <= -4.1e+52) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif (x1 <= -2.7e-182) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(t_1 - 2.0)))); elseif (x1 <= 6e-187) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); elseif (x1 <= 2e+80) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(4.0 * Float64(x1 * t_0))))); elseif (x1 <= 1.35e+154) tmp = Float64(x1 + Float64(t_2 + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + -6.0)))); else tmp = Float64(x1 + Float64(x1 * Float64(1.0 + t_1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x2 * ((2.0 * x2) - 3.0); t_1 = 4.0 * t_0; t_2 = 3.0 * ((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)); tmp = 0.0; if (x1 <= -4.1e+52) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif (x1 <= -2.7e-182) tmp = x1 + ((x2 * -6.0) + (x1 * (t_1 - 2.0))); elseif (x1 <= 6e-187) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); elseif (x1 <= 2e+80) tmp = x1 + (t_2 + (x1 + (4.0 * (x1 * t_0)))); elseif (x1 <= 1.35e+154) tmp = x1 + (t_2 + (x1 + ((x1 * (x1 * x1)) + -6.0))); else tmp = x1 + (x1 * (1.0 + t_1)); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(3.0 * N[(N[(N[(N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -4.1e+52], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -2.7e-182], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(t$95$1 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 6e-187], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 2e+80], N[(x1 + N[(t$95$2 + N[(x1 + N[(4.0 * N[(x1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 1.35e+154], N[(x1 + N[(t$95$2 + N[(x1 + N[(N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x2 \cdot \left(2 \cdot x2 - 3\right)\\
t_1 := 4 \cdot t\_0\\
t_2 := 3 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\\
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.7 \cdot 10^{-182}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(t\_1 - 2\right)\right)\\
\mathbf{elif}\;x1 \leq 6 \cdot 10^{-187}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\mathbf{elif}\;x1 \leq 2 \cdot 10^{+80}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + 4 \cdot \left(x1 \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;x1 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x1 + \left(t\_2 + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + -6\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot \left(1 + t\_1\right)\\
\end{array}
\end{array}
if x1 < -4.1e52Initial program 20.7%
Taylor expanded in x1 around inf 15.7%
*-commutative15.7%
Simplified15.7%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.6%
mul-1-neg5.6%
unsub-neg5.6%
*-commutative5.6%
Simplified5.6%
Taylor expanded in x2 around 0 15.0%
if -4.1e52 < x1 < -2.69999999999999999e-182Initial program 99.2%
Taylor expanded in x1 around inf 96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x1 around 0 80.0%
Taylor expanded in x1 around 0 80.2%
if -2.69999999999999999e-182 < x1 < 6.00000000000000008e-187Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
if 6.00000000000000008e-187 < x1 < 2e80Initial program 99.5%
Taylor expanded in x1 around inf 96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in x1 around 0 79.1%
if 2e80 < x1 < 1.35000000000000003e154Initial program 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around inf 100.0%
Taylor expanded in x1 around 0 35.7%
Taylor expanded in x1 around 0 74.3%
if 1.35000000000000003e154 < x1 Initial program 0.0%
Taylor expanded in x1 around inf 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x1 around inf 38.9%
Final simplification58.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -4.1e+52)
(+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))
(if (or (<= x1 -2.3e-182) (not (<= x1 6.5e-188)))
(+ x1 (+ (* x2 -6.0) (* x1 (- (* 4.0 (* x2 (- (* 2.0 x2) 3.0))) 2.0))))
(+ x1 (+ (* x2 -6.0) (* x1 -2.0))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if ((x1 <= -2.3e-182) || !(x1 <= 6.5e-188)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-4.1d+52)) then
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
else if ((x1 <= (-2.3d-182)) .or. (.not. (x1 <= 6.5d-188))) then
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * ((4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0))) - 2.0d0)))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -4.1e+52) {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
} else if ((x1 <= -2.3e-182) || !(x1 <= 6.5e-188)) {
tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0)));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -4.1e+52: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) elif (x1 <= -2.3e-182) or not (x1 <= 6.5e-188): tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -4.1e+52) tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); elseif ((x1 <= -2.3e-182) || !(x1 <= 6.5e-188)) tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0))) - 2.0)))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -4.1e+52) tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); elseif ((x1 <= -2.3e-182) || ~((x1 <= 6.5e-188))) tmp = x1 + ((x2 * -6.0) + (x1 * ((4.0 * (x2 * ((2.0 * x2) - 3.0))) - 2.0))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -4.1e+52], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -2.3e-182], N[Not[LessEqual[x1, 6.5e-188]], $MachinePrecision]], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -4.1 \cdot 10^{+52}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\mathbf{elif}\;x1 \leq -2.3 \cdot 10^{-182} \lor \neg \left(x1 \leq 6.5 \cdot 10^{-188}\right):\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot \left(4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right) - 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x1 < -4.1e52Initial program 20.7%
Taylor expanded in x1 around inf 15.7%
*-commutative15.7%
Simplified15.7%
Taylor expanded in x1 around 0 2.1%
Taylor expanded in x1 around 0 5.6%
mul-1-neg5.6%
unsub-neg5.6%
*-commutative5.6%
Simplified5.6%
Taylor expanded in x2 around 0 15.0%
if -4.1e52 < x1 < -2.2999999999999999e-182 or 6.4999999999999998e-188 < x1 Initial program 72.8%
Taylor expanded in x1 around inf 70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in x1 around 0 53.9%
Taylor expanded in x1 around 0 62.9%
if -2.2999999999999999e-182 < x1 < 6.4999999999999998e-188Initial program 99.7%
Taylor expanded in x1 around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x1 around inf 82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in x1 around 0 83.2%
Final simplification55.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -1.06e+149) (not (<= x2 2.7e+156))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (+ x1 (+ (* x2 -6.0) (* x1 -2.0)))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.06e+149) || !(x2 <= 2.7e+156)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-1.06d+149)) .or. (.not. (x2 <= 2.7d+156))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -1.06e+149) || !(x2 <= 2.7e+156)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + ((x2 * -6.0) + (x1 * -2.0));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -1.06e+149) or not (x2 <= 2.7e+156): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -1.06e+149) || !(x2 <= 2.7e+156)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -1.06e+149) || ~((x2 <= 2.7e+156))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -1.06e+149], N[Not[LessEqual[x2, 2.7e+156]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -1.06 \cdot 10^{+149} \lor \neg \left(x2 \leq 2.7 \cdot 10^{+156}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)\\
\end{array}
\end{array}
if x2 < -1.05999999999999993e149 or 2.7e156 < x2 Initial program 70.4%
Taylor expanded in x1 around inf 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x1 around 0 44.1%
Taylor expanded in x1 around inf 63.8%
if -1.05999999999999993e149 < x2 < 2.7e156Initial program 63.9%
Taylor expanded in x1 around inf 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in x1 around inf 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in x1 around 0 43.1%
Final simplification48.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -3.8e+187) (not (<= x2 2.55e+179))) (+ x1 (* x1 (+ 1.0 (* 4.0 (* x2 (- (* 2.0 x2) 3.0)))))) (+ x1 (+ x1 (+ (* x1 -3.0) (* x2 (- (* x1 -12.0) 6.0)))))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.8e+187) || !(x2 <= 2.55e+179)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-3.8d+187)) .or. (.not. (x2 <= 2.55d+179))) then
tmp = x1 + (x1 * (1.0d0 + (4.0d0 * (x2 * ((2.0d0 * x2) - 3.0d0)))))
else
tmp = x1 + (x1 + ((x1 * (-3.0d0)) + (x2 * ((x1 * (-12.0d0)) - 6.0d0))))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -3.8e+187) || !(x2 <= 2.55e+179)) {
tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0)))));
} else {
tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0))));
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -3.8e+187) or not (x2 <= 2.55e+179): tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))) else: tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -3.8e+187) || !(x2 <= 2.55e+179)) tmp = Float64(x1 + Float64(x1 * Float64(1.0 + Float64(4.0 * Float64(x2 * Float64(Float64(2.0 * x2) - 3.0)))))); else tmp = Float64(x1 + Float64(x1 + Float64(Float64(x1 * -3.0) + Float64(x2 * Float64(Float64(x1 * -12.0) - 6.0))))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -3.8e+187) || ~((x2 <= 2.55e+179))) tmp = x1 + (x1 * (1.0 + (4.0 * (x2 * ((2.0 * x2) - 3.0))))); else tmp = x1 + (x1 + ((x1 * -3.0) + (x2 * ((x1 * -12.0) - 6.0)))); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -3.8e+187], N[Not[LessEqual[x2, 2.55e+179]], $MachinePrecision]], N[(x1 + N[(x1 * N[(1.0 + N[(4.0 * N[(x2 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 + N[(N[(x1 * -3.0), $MachinePrecision] + N[(x2 * N[(N[(x1 * -12.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -3.8 \cdot 10^{+187} \lor \neg \left(x2 \leq 2.55 \cdot 10^{+179}\right):\\
\;\;\;\;x1 + x1 \cdot \left(1 + 4 \cdot \left(x2 \cdot \left(2 \cdot x2 - 3\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x1 + \left(x1 + \left(x1 \cdot -3 + x2 \cdot \left(x1 \cdot -12 - 6\right)\right)\right)\\
\end{array}
\end{array}
if x2 < -3.8e187 or 2.5500000000000001e179 < x2 Initial program 75.5%
Taylor expanded in x1 around inf 73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in x1 around 0 55.8%
Taylor expanded in x1 around inf 74.7%
if -3.8e187 < x2 < 2.5500000000000001e179Initial program 63.2%
Taylor expanded in x1 around inf 60.8%
*-commutative60.8%
Simplified60.8%
Taylor expanded in x1 around 0 41.2%
Taylor expanded in x1 around 0 43.9%
mul-1-neg43.9%
unsub-neg43.9%
*-commutative43.9%
Simplified43.9%
Taylor expanded in x2 around 0 44.0%
Final simplification50.3%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -6.6e-166) (not (<= x2 1.25e-192))) (* x2 -6.0) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.6e-166) || !(x2 <= 1.25e-192)) {
tmp = x2 * -6.0;
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-6.6d-166)) .or. (.not. (x2 <= 1.25d-192))) then
tmp = x2 * (-6.0d0)
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -6.6e-166) || !(x2 <= 1.25e-192)) {
tmp = x2 * -6.0;
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -6.6e-166) or not (x2 <= 1.25e-192): tmp = x2 * -6.0 else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -6.6e-166) || !(x2 <= 1.25e-192)) tmp = Float64(x2 * -6.0); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -6.6e-166) || ~((x2 <= 1.25e-192))) tmp = x2 * -6.0; else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -6.6e-166], N[Not[LessEqual[x2, 1.25e-192]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -6.6 \cdot 10^{-166} \lor \neg \left(x2 \leq 1.25 \cdot 10^{-192}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -6.60000000000000036e-166 or 1.25e-192 < x2 Initial program 65.3%
Taylor expanded in x1 around inf 63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in x1 around 0 41.5%
Taylor expanded in x1 around 0 26.1%
*-commutative26.1%
Simplified26.1%
Taylor expanded in x1 around 0 25.6%
if -6.60000000000000036e-166 < x2 < 1.25e-192Initial program 66.9%
Taylor expanded in x1 around inf 64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 51.9%
mul-1-neg51.9%
unsub-neg51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in x2 around 0 47.3%
distribute-rgt1-in47.9%
metadata-eval47.9%
*-commutative47.9%
Simplified47.9%
Final simplification31.8%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -5.6e-165) (not (<= x2 3e-194))) (+ x1 (* x2 -6.0)) (+ x1 (* x1 -2.0))))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -5.6e-165) || !(x2 <= 3e-194)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-5.6d-165)) .or. (.not. (x2 <= 3d-194))) then
tmp = x1 + (x2 * (-6.0d0))
else
tmp = x1 + (x1 * (-2.0d0))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -5.6e-165) || !(x2 <= 3e-194)) {
tmp = x1 + (x2 * -6.0);
} else {
tmp = x1 + (x1 * -2.0);
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -5.6e-165) or not (x2 <= 3e-194): tmp = x1 + (x2 * -6.0) else: tmp = x1 + (x1 * -2.0) return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -5.6e-165) || !(x2 <= 3e-194)) tmp = Float64(x1 + Float64(x2 * -6.0)); else tmp = Float64(x1 + Float64(x1 * -2.0)); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -5.6e-165) || ~((x2 <= 3e-194))) tmp = x1 + (x2 * -6.0); else tmp = x1 + (x1 * -2.0); end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -5.6e-165], N[Not[LessEqual[x2, 3e-194]], $MachinePrecision]], N[(x1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], N[(x1 + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -5.6 \cdot 10^{-165} \lor \neg \left(x2 \leq 3 \cdot 10^{-194}\right):\\
\;\;\;\;x1 + x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;x1 + x1 \cdot -2\\
\end{array}
\end{array}
if x2 < -5.5999999999999999e-165 or 3e-194 < x2 Initial program 65.3%
Taylor expanded in x1 around inf 63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in x1 around 0 41.5%
Taylor expanded in x1 around 0 26.1%
*-commutative26.1%
Simplified26.1%
if -5.5999999999999999e-165 < x2 < 3e-194Initial program 66.9%
Taylor expanded in x1 around inf 64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x1 around 0 51.2%
Taylor expanded in x1 around 0 51.9%
mul-1-neg51.9%
unsub-neg51.9%
*-commutative51.9%
Simplified51.9%
Taylor expanded in x2 around 0 47.3%
distribute-rgt1-in47.9%
metadata-eval47.9%
*-commutative47.9%
Simplified47.9%
Final simplification32.2%
(FPCore (x1 x2) :precision binary64 (+ x1 (+ (* x2 -6.0) (* x1 -2.0))))
double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1 + ((x2 * (-6.0d0)) + (x1 * (-2.0d0)))
end function
public static double code(double x1, double x2) {
return x1 + ((x2 * -6.0) + (x1 * -2.0));
}
def code(x1, x2): return x1 + ((x2 * -6.0) + (x1 * -2.0))
function code(x1, x2) return Float64(x1 + Float64(Float64(x2 * -6.0) + Float64(x1 * -2.0))) end
function tmp = code(x1, x2) tmp = x1 + ((x2 * -6.0) + (x1 * -2.0)); end
code[x1_, x2_] := N[(x1 + N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x1 + \left(x2 \cdot -6 + x1 \cdot -2\right)
\end{array}
Initial program 65.7%
Taylor expanded in x1 around inf 63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x1 around inf 50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in x1 around 0 35.2%
Final simplification35.2%
(FPCore (x1 x2) :precision binary64 (* x2 -6.0))
double code(double x1, double x2) {
return x2 * -6.0;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x2 * (-6.0d0)
end function
public static double code(double x1, double x2) {
return x2 * -6.0;
}
def code(x1, x2): return x2 * -6.0
function code(x1, x2) return Float64(x2 * -6.0) end
function tmp = code(x1, x2) tmp = x2 * -6.0; end
code[x1_, x2_] := N[(x2 * -6.0), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6
\end{array}
Initial program 65.7%
Taylor expanded in x1 around inf 63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x1 around 0 44.2%
Taylor expanded in x1 around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in x1 around 0 20.4%
Final simplification20.4%
(FPCore (x1 x2) :precision binary64 x1)
double code(double x1, double x2) {
return x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = x1
end function
public static double code(double x1, double x2) {
return x1;
}
def code(x1, x2): return x1
function code(x1, x2) return x1 end
function tmp = code(x1, x2) tmp = x1; end
code[x1_, x2_] := x1
\begin{array}{l}
\\
x1
\end{array}
Initial program 65.7%
Taylor expanded in x1 around inf 63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in x1 around 0 44.2%
Taylor expanded in x1 around 0 20.6%
*-commutative20.6%
Simplified20.6%
Taylor expanded in x1 around inf 3.3%
Final simplification3.3%
herbie shell --seed 2024046
(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))))))