
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* (* 3.0 x1) x1))
(t_1 (+ (* x1 x1) 1.0))
(t_2 (/ (- (+ t_0 (* 2.0 x2)) x1) t_1)))
(+
x1
(+
(+
(+
(+
(*
(+
(* (* (* 2.0 x1) t_2) (- t_2 3.0))
(* (* x1 x1) (- (* 4.0 t_2) 6.0)))
t_1)
(* t_0 t_2))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))))))
double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (3.0d0 * x1) * x1
t_1 = (x1 * x1) + 1.0d0
t_2 = ((t_0 + (2.0d0 * x2)) - x1) / t_1
code = x1 + (((((((((2.0d0 * x1) * t_2) * (t_2 - 3.0d0)) + ((x1 * x1) * ((4.0d0 * t_2) - 6.0d0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)))
end function
public static double code(double x1, double x2) {
double t_0 = (3.0 * x1) * x1;
double t_1 = (x1 * x1) + 1.0;
double t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1;
return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)));
}
def code(x1, x2): t_0 = (3.0 * x1) * x1 t_1 = (x1 * x1) + 1.0 t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1 return x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)))
function code(x1, x2) t_0 = Float64(Float64(3.0 * x1) * x1) t_1 = Float64(Float64(x1 * x1) + 1.0) t_2 = Float64(Float64(Float64(t_0 + Float64(2.0 * x2)) - x1) / t_1) return Float64(x1 + Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * x1) * t_2) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * Float64(Float64(4.0 * t_2) - 6.0))) * t_1) + Float64(t_0 * t_2)) + Float64(Float64(x1 * x1) * x1)) + x1) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)))) end
function tmp = code(x1, x2) t_0 = (3.0 * x1) * x1; t_1 = (x1 * x1) + 1.0; t_2 = ((t_0 + (2.0 * x2)) - x1) / t_1; tmp = x1 + (((((((((2.0 * x1) * t_2) * (t_2 - 3.0)) + ((x1 * x1) * ((4.0 * t_2) - 6.0))) * t_1) + (t_0 * t_2)) + ((x1 * x1) * x1)) + x1) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1))); end
code[x1_, x2_] := Block[{t$95$0 = N[(N[(3.0 * x1), $MachinePrecision] * x1), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]}, N[(x1 + N[(N[(N[(N[(N[(N[(N[(N[(N[(2.0 * x1), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(N[(4.0 * t$95$2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * x1), $MachinePrecision]), $MachinePrecision] + x1), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(3 \cdot x1\right) \cdot x1\\
t_1 := x1 \cdot x1 + 1\\
t_2 := \frac{\left(t\_0 + 2 \cdot x2\right) - x1}{t\_1}\\
x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot t\_2\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot t\_2 - 6\right)\right) \cdot t\_1 + t\_0 \cdot t\_2\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1}\right)
\end{array}
\end{array}
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (fma x1 (* x1 3.0) (* 2.0 x2)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- x1 t_0) (fma x1 x1 1.0)))
(t_4 (* 3.0 (* x1 x1)))
(t_5 (* x1 (* x1 3.0)))
(t_6 (- x1 (+ t_5 (* 2.0 x2))))
(t_7 (/ t_6 t_1))
(t_8 (/ t_6 t_2))
(t_9 (/ (- t_0 x1) (fma x1 x1 1.0))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_8)))
(* (* t_7 (* x1 2.0)) (+ 3.0 t_8))))
(* t_5 t_7))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_5 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(fma
3.0
(/ (- t_4 (fma 2.0 x2 x1)) (fma x1 x1 1.0))
(+
x1
(fma
(fma x1 x1 1.0)
(fma x1 (* x1 (fma t_9 4.0 -6.0)) (* (* x1 (* 2.0 t_3)) (- t_3 -3.0)))
(fma t_4 t_9 (pow x1 3.0))))))
(*
(pow x1 4.0)
(-
6.0
(/ (- 3.0 (/ (- 15.0 (+ 6.0 (* -4.0 (- (* 2.0 x2) 3.0)))) x1)) x1))))))
double code(double x1, double x2) {
double t_0 = fma(x1, (x1 * 3.0), (2.0 * x2));
double t_1 = -1.0 - (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (x1 - t_0) / fma(x1, x1, 1.0);
double t_4 = 3.0 * (x1 * x1);
double t_5 = x1 * (x1 * 3.0);
double t_6 = x1 - (t_5 + (2.0 * x2));
double t_7 = t_6 / t_1;
double t_8 = t_6 / t_2;
double t_9 = (t_0 - x1) / fma(x1, x1, 1.0);
double tmp;
if ((x1 + ((x1 + (((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_8))) + ((t_7 * (x1 * 2.0)) * (3.0 + t_8)))) + (t_5 * t_7)) + (x1 * (x1 * x1)))) + (3.0 * (((t_5 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + fma(3.0, ((t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), (x1 + fma(fma(x1, x1, 1.0), fma(x1, (x1 * fma(t_9, 4.0, -6.0)), ((x1 * (2.0 * t_3)) * (t_3 - -3.0))), fma(t_4, t_9, pow(x1, 3.0)))));
} else {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1));
}
return tmp;
}
function code(x1, x2) t_0 = fma(x1, Float64(x1 * 3.0), Float64(2.0 * x2)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(x1 - t_0) / fma(x1, x1, 1.0)) t_4 = Float64(3.0 * Float64(x1 * x1)) t_5 = Float64(x1 * Float64(x1 * 3.0)) t_6 = Float64(x1 - Float64(t_5 + Float64(2.0 * x2))) t_7 = Float64(t_6 / t_1) t_8 = Float64(t_6 / t_2) t_9 = Float64(Float64(t_0 - x1) / fma(x1, x1, 1.0)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_8))) + Float64(Float64(t_7 * Float64(x1 * 2.0)) * Float64(3.0 + t_8)))) + Float64(t_5 * t_7)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_5 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + fma(3.0, Float64(Float64(t_4 - fma(2.0, x2, x1)) / fma(x1, x1, 1.0)), Float64(x1 + fma(fma(x1, x1, 1.0), fma(x1, Float64(x1 * fma(t_9, 4.0, -6.0)), Float64(Float64(x1 * Float64(2.0 * t_3)) * Float64(t_3 - -3.0))), fma(t_4, t_9, (x1 ^ 3.0)))))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(15.0 - Float64(6.0 + Float64(-4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1)) / x1))); end return tmp end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(x1 * 3.0), $MachinePrecision] + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 - t$95$0), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(3.0 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(x1 * N[(x1 * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(x1 - N[(t$95$5 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 / t$95$1), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$6 / t$95$2), $MachinePrecision]}, Block[{t$95$9 = N[(N[(t$95$0 - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$7 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 * t$95$7), $MachinePrecision]), $MachinePrecision] + N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$5 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(3.0 * N[(N[(t$95$4 - N[(2.0 * x2 + x1), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(N[(x1 * x1 + 1.0), $MachinePrecision] * N[(x1 * N[(x1 * N[(t$95$9 * 4.0 + -6.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * N[(2.0 * t$95$3), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * t$95$9 + N[Power[x1, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(15.0 - N[(6.0 + N[(-4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x1, x1 \cdot 3, 2 \cdot x2\right)\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{x1 - t\_0}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := 3 \cdot \left(x1 \cdot x1\right)\\
t_5 := x1 \cdot \left(x1 \cdot 3\right)\\
t_6 := x1 - \left(t\_5 + 2 \cdot x2\right)\\
t_7 := \frac{t\_6}{t\_1}\\
t_8 := \frac{t\_6}{t\_2}\\
t_9 := \frac{t\_0 - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_8\right) + \left(t\_7 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_8\right)\right) + t\_5 \cdot t\_7\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_5 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \mathsf{fma}\left(3, \frac{t\_4 - \mathsf{fma}\left(2, x2, x1\right)}{\mathsf{fma}\left(x1, x1, 1\right)}, x1 + \mathsf{fma}\left(\mathsf{fma}\left(x1, x1, 1\right), \mathsf{fma}\left(x1, x1 \cdot \mathsf{fma}\left(t\_9, 4, -6\right), \left(x1 \cdot \left(2 \cdot t\_3\right)\right) \cdot \left(t\_3 - -3\right)\right), \mathsf{fma}\left(t\_4, t\_9, {x1}^{3}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{15 - \left(6 + -4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{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.5%
Simplified99.7%
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%
Simplified12.2%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.8%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (/ (- (fma (* x1 3.0) x1 (* 2.0 x2)) x1) (fma x1 x1 1.0)))
(t_4 (- x1 (+ t_0 (* 2.0 x2))))
(t_5 (/ t_4 t_2))
(t_6 (/ t_4 t_1))
(t_7 (* x1 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(*
t_1
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* t_6 (* x1 2.0)) (+ 3.0 t_5))))
(* t_0 t_6))
t_7))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))))
INFINITY)
(+
x1
(+
(+
t_7
(fma
(fma (* (* x1 2.0) t_3) (+ -3.0 t_3) (* (* x1 x1) (fma 4.0 t_3 -6.0)))
(fma x1 x1 1.0)
(* t_0 t_3)))
(+ x1 (* 3.0 (/ (- t_0 (+ x1 (* 2.0 x2))) (fma x1 x1 1.0))))))
(*
(pow x1 4.0)
(-
6.0
(/ (- 3.0 (/ (- 15.0 (+ 6.0 (* -4.0 (- (* 2.0 x2) 3.0)))) x1)) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = -1.0 - (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = (fma((x1 * 3.0), x1, (2.0 * x2)) - x1) / fma(x1, x1, 1.0);
double t_4 = x1 - (t_0 + (2.0 * x2));
double t_5 = t_4 / t_2;
double t_6 = t_4 / t_1;
double t_7 = x1 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_6 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_6)) + t_7)) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)))) <= ((double) INFINITY)) {
tmp = x1 + ((t_7 + fma(fma(((x1 * 2.0) * t_3), (-3.0 + t_3), ((x1 * x1) * fma(4.0, t_3, -6.0))), fma(x1, x1, 1.0), (t_0 * t_3))) + (x1 + (3.0 * ((t_0 - (x1 + (2.0 * x2))) / fma(x1, x1, 1.0)))));
} else {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(Float64(fma(Float64(x1 * 3.0), x1, Float64(2.0 * x2)) - x1) / fma(x1, x1, 1.0)) t_4 = Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) t_5 = Float64(t_4 / t_2) t_6 = Float64(t_4 / t_1) t_7 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(t_6 * Float64(x1 * 2.0)) * Float64(3.0 + t_5)))) + Float64(t_0 * t_6)) + t_7)) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)))) <= Inf) tmp = Float64(x1 + Float64(Float64(t_7 + fma(fma(Float64(Float64(x1 * 2.0) * t_3), Float64(-3.0 + t_3), Float64(Float64(x1 * x1) * fma(4.0, t_3, -6.0))), fma(x1, x1, 1.0), Float64(t_0 * t_3))) + Float64(x1 + Float64(3.0 * Float64(Float64(t_0 - Float64(x1 + Float64(2.0 * x2))) / fma(x1, x1, 1.0)))))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(15.0 - Float64(6.0 + Float64(-4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1)) / x1))); end return 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]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x1 * 3.0), $MachinePrecision] * x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$2), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 / t$95$1), $MachinePrecision]}, Block[{t$95$7 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$6 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$6), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision]), $MachinePrecision] + N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(N[(t$95$7 + N[(N[(N[(N[(x1 * 2.0), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-3.0 + t$95$3), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * N[(4.0 * t$95$3 + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x1 * x1 + 1.0), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x1 + N[(3.0 * N[(N[(t$95$0 - N[(x1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(15.0 - N[(6.0 + N[(-4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := \frac{\mathsf{fma}\left(x1 \cdot 3, x1, 2 \cdot x2\right) - x1}{\mathsf{fma}\left(x1, x1, 1\right)}\\
t_4 := x1 - \left(t\_0 + 2 \cdot x2\right)\\
t_5 := \frac{t\_4}{t\_2}\\
t_6 := \frac{t\_4}{t\_1}\\
t_7 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(t\_6 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_5\right)\right) + t\_0 \cdot t\_6\right) + t\_7\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\right) \leq \infty:\\
\;\;\;\;x1 + \left(\left(t\_7 + \mathsf{fma}\left(\mathsf{fma}\left(\left(x1 \cdot 2\right) \cdot t\_3, -3 + t\_3, \left(x1 \cdot x1\right) \cdot \mathsf{fma}\left(4, t\_3, -6\right)\right), \mathsf{fma}\left(x1, x1, 1\right), t\_0 \cdot t\_3\right)\right) + \left(x1 + 3 \cdot \frac{t\_0 - \left(x1 + 2 \cdot x2\right)}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{15 - \left(6 + -4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{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.5%
Simplified99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified12.2%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (+ (* x1 x1) 1.0))
(t_3 (* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2)))
(t_4 (- x1 (+ t_0 (* 2.0 x2))))
(t_5 (/ t_4 t_1))
(t_6 (* t_5 (* x1 2.0)))
(t_7 (/ t_4 t_2))
(t_8 (* x1 (* x1 x1))))
(if (<=
(+
x1
(+
(+
x1
(+
(+
(* t_1 (+ (* (* x1 x1) (+ 6.0 (* 4.0 t_7))) (* t_6 (+ 3.0 t_7))))
(* t_0 t_5))
t_8))
t_3))
INFINITY)
(+
x1
(+
t_3
(+
x1
(-
t_8
(-
(* t_0 t_7)
(*
t_2
(-
(* (* x1 x1) (- (* t_5 4.0) 6.0))
(*
t_6
(+
3.0
(*
(+ (* 2.0 x2) (* x1 (+ (* x1 3.0) -1.0)))
(/ -1.0 (fma x1 x1 1.0))))))))))))
(*
(pow x1 4.0)
(-
6.0
(/ (- 3.0 (/ (- 15.0 (+ 6.0 (* -4.0 (- (* 2.0 x2) 3.0)))) x1)) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = -1.0 - (x1 * x1);
double t_2 = (x1 * x1) + 1.0;
double t_3 = 3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2);
double t_4 = x1 - (t_0 + (2.0 * x2));
double t_5 = t_4 / t_1;
double t_6 = t_5 * (x1 * 2.0);
double t_7 = t_4 / t_2;
double t_8 = x1 * (x1 * x1);
double tmp;
if ((x1 + ((x1 + (((t_1 * (((x1 * x1) * (6.0 + (4.0 * t_7))) + (t_6 * (3.0 + t_7)))) + (t_0 * t_5)) + t_8)) + t_3)) <= ((double) INFINITY)) {
tmp = x1 + (t_3 + (x1 + (t_8 - ((t_0 * t_7) - (t_2 * (((x1 * x1) * ((t_5 * 4.0) - 6.0)) - (t_6 * (3.0 + (((2.0 * x2) + (x1 * ((x1 * 3.0) + -1.0))) * (-1.0 / fma(x1, x1, 1.0)))))))))));
} else {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1));
}
return tmp;
}
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) t_4 = Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) t_5 = Float64(t_4 / t_1) t_6 = Float64(t_5 * Float64(x1 * 2.0)) t_7 = Float64(t_4 / t_2) t_8 = Float64(x1 * Float64(x1 * x1)) tmp = 0.0 if (Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_1 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_7))) + Float64(t_6 * Float64(3.0 + t_7)))) + Float64(t_0 * t_5)) + t_8)) + t_3)) <= Inf) tmp = Float64(x1 + Float64(t_3 + Float64(x1 + Float64(t_8 - Float64(Float64(t_0 * t_7) - Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_5 * 4.0) - 6.0)) - Float64(t_6 * Float64(3.0 + Float64(Float64(Float64(2.0 * x2) + Float64(x1 * Float64(Float64(x1 * 3.0) + -1.0))) * Float64(-1.0 / fma(x1, x1, 1.0)))))))))))); else tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(15.0 - Float64(6.0 + Float64(-4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1)) / x1))); end return 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]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$4 / t$95$2), $MachinePrecision]}, Block[{t$95$8 = N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$1 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 * N[(3.0 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$8), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], Infinity], N[(x1 + N[(t$95$3 + N[(x1 + N[(t$95$8 - N[(N[(t$95$0 * t$95$7), $MachinePrecision] - N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$5 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] - N[(t$95$6 * N[(3.0 + N[(N[(N[(2.0 * x2), $MachinePrecision] + N[(x1 * N[(N[(x1 * 3.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(x1 * x1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(15.0 - N[(6.0 + N[(-4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := -1 - x1 \cdot x1\\
t_2 := x1 \cdot x1 + 1\\
t_3 := 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2}\\
t_4 := x1 - \left(t\_0 + 2 \cdot x2\right)\\
t_5 := \frac{t\_4}{t\_1}\\
t_6 := t\_5 \cdot \left(x1 \cdot 2\right)\\
t_7 := \frac{t\_4}{t\_2}\\
t_8 := x1 \cdot \left(x1 \cdot x1\right)\\
\mathbf{if}\;x1 + \left(\left(x1 + \left(\left(t\_1 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_7\right) + t\_6 \cdot \left(3 + t\_7\right)\right) + t\_0 \cdot t\_5\right) + t\_8\right)\right) + t\_3\right) \leq \infty:\\
\;\;\;\;x1 + \left(t\_3 + \left(x1 + \left(t\_8 - \left(t\_0 \cdot t\_7 - t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_5 \cdot 4 - 6\right) - t\_6 \cdot \left(3 + \left(2 \cdot x2 + x1 \cdot \left(x1 \cdot 3 + -1\right)\right) \cdot \frac{-1}{\mathsf{fma}\left(x1, x1, 1\right)}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{15 - \left(6 + -4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{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.5%
fma-define99.5%
div-inv99.5%
associate-*r*99.5%
fma-define99.5%
pow299.5%
Applied egg-rr99.5%
Taylor expanded in x1 around 0 99.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified12.2%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- x1 (+ t_0 (* 2.0 x2))))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ t_1 t_2))
(t_4 (+ (* x1 x1) 1.0))
(t_5 (/ t_1 t_4))
(t_6
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* t_3 (* x1 2.0)) (+ 3.0 t_5))))
(* t_0 t_3))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_4))))))
(if (<= t_6 INFINITY)
t_6
(*
(pow x1 4.0)
(-
6.0
(/ (- 3.0 (/ (- 15.0 (+ 6.0 (* -4.0 (- (* 2.0 x2) 3.0)))) x1)) x1))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = t_1 / t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = t_1 / t_4;
double t_6 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_3 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)));
double tmp;
if (t_6 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1));
}
return tmp;
}
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = t_1 / t_2;
double t_4 = (x1 * x1) + 1.0;
double t_5 = t_1 / t_4;
double t_6 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_3 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4)));
double tmp;
if (t_6 <= Double.POSITIVE_INFINITY) {
tmp = t_6;
} else {
tmp = Math.pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 - (t_0 + (2.0 * x2)) t_2 = -1.0 - (x1 * x1) t_3 = t_1 / t_2 t_4 = (x1 * x1) + 1.0 t_5 = t_1 / t_4 t_6 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_3 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4))) tmp = 0 if t_6 <= math.inf: tmp = t_6 else: tmp = math.pow(x1, 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / x1)) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(t_1 / t_2) t_4 = Float64(Float64(x1 * x1) + 1.0) t_5 = Float64(t_1 / t_4) t_6 = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(3.0 + t_5)))) + Float64(t_0 * t_3)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_4)))) tmp = 0.0 if (t_6 <= Inf) tmp = t_6; else tmp = Float64((x1 ^ 4.0) * Float64(6.0 - Float64(Float64(3.0 - Float64(Float64(15.0 - Float64(6.0 + Float64(-4.0 * Float64(Float64(2.0 * x2) - 3.0)))) / x1)) / x1))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 - (t_0 + (2.0 * x2)); t_2 = -1.0 - (x1 * x1); t_3 = t_1 / t_2; t_4 = (x1 * x1) + 1.0; t_5 = t_1 / t_4; t_6 = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_3 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_3)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_4))); tmp = 0.0; if (t_6 <= Inf) tmp = t_6; else tmp = (x1 ^ 4.0) * (6.0 - ((3.0 - ((15.0 - (6.0 + (-4.0 * ((2.0 * x2) - 3.0)))) / x1)) / 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[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$3), $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$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, Infinity], t$95$6, N[(N[Power[x1, 4.0], $MachinePrecision] * N[(6.0 - N[(N[(3.0 - N[(N[(15.0 - N[(6.0 + N[(-4.0 * N[(N[(2.0 * x2), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision] / x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 - \left(t\_0 + 2 \cdot x2\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{t\_1}{t\_2}\\
t_4 := x1 \cdot x1 + 1\\
t_5 := \frac{t\_1}{t\_4}\\
t_6 := x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_5\right)\right) + t\_0 \cdot t\_3\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_4}\right)\\
\mathbf{if}\;t\_6 \leq \infty:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;{x1}^{4} \cdot \left(6 - \frac{3 - \frac{15 - \left(6 + -4 \cdot \left(2 \cdot x2 - 3\right)\right)}{x1}}{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.5%
if +inf.0 < (+.f64 x1 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 (+.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) (-.f64 (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) #s(literal 3 binary64))) (*.f64 (*.f64 x1 x1) (-.f64 (*.f64 #s(literal 4 binary64) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))) #s(literal 6 binary64)))) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))) (*.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (/.f64 (-.f64 (+.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64))))) (*.f64 (*.f64 x1 x1) x1)) x1) (*.f64 #s(literal 3 binary64) (/.f64 (-.f64 (-.f64 (*.f64 (*.f64 #s(literal 3 binary64) x1) x1) (*.f64 #s(literal 2 binary64) x2)) x1) (+.f64 (*.f64 x1 x1) #s(literal 1 binary64)))))) Initial program 0.0%
Simplified12.2%
Taylor expanded in x1 around -inf 100.0%
Final simplification99.6%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- x1 (+ t_0 (* 2.0 x2))))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (+ (* x1 x1) 1.0))
(t_4 (/ t_1 t_2))
(t_5 (/ t_1 t_3)))
(if (<= x1 -5e+102)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 5e+153)
(+
x1
(+
(+
x1
(+
(+
(*
t_2
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_5)))
(* (* t_4 (* x1 2.0)) (+ 3.0 t_5))))
(* t_0 t_4))
(* x1 (* x1 x1))))
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_3))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_1 / t_2;
double t_5 = t_1 / t_3;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_4 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = x1 - (t_0 + (2.0d0 * x2))
t_2 = (-1.0d0) - (x1 * x1)
t_3 = (x1 * x1) + 1.0d0
t_4 = t_1 / t_2
t_5 = t_1 / t_3
if (x1 <= (-5d+102)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_5))) + ((t_4 * (x1 * 2.0d0)) * (3.0d0 + t_5)))) + (t_0 * t_4)) + (x1 * (x1 * x1)))) + (3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_3)))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = (x1 * x1) + 1.0;
double t_4 = t_1 / t_2;
double t_5 = t_1 / t_3;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_4 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3)));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 - (t_0 + (2.0 * x2)) t_2 = -1.0 - (x1 * x1) t_3 = (x1 * x1) + 1.0 t_4 = t_1 / t_2 t_5 = t_1 / t_3 tmp = 0 if x1 <= -5e+102: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= 5e+153: tmp = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_4 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(Float64(x1 * x1) + 1.0) t_4 = Float64(t_1 / t_2) t_5 = Float64(t_1 / t_3) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(x1 + Float64(Float64(Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_5))) + Float64(Float64(t_4 * Float64(x1 * 2.0)) * Float64(3.0 + t_5)))) + Float64(t_0 * t_4)) + Float64(x1 * Float64(x1 * x1)))) + Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_3)))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 - (t_0 + (2.0 * x2)); t_2 = -1.0 - (x1 * x1); t_3 = (x1 * x1) + 1.0; t_4 = t_1 / t_2; t_5 = t_1 / t_3; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= 5e+153) tmp = x1 + ((x1 + (((t_2 * (((x1 * x1) * (6.0 + (4.0 * t_5))) + ((t_4 * (x1 * 2.0)) * (3.0 + t_5)))) + (t_0 * t_4)) + (x1 * (x1 * x1)))) + (3.0 * (((t_0 - (2.0 * x2)) - x1) / t_3))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 / t$95$3), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(x1 + N[(N[(N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$4), $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$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 - \left(t\_0 + 2 \cdot x2\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := x1 \cdot x1 + 1\\
t_4 := \frac{t\_1}{t\_2}\\
t_5 := \frac{t\_1}{t\_3}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(\left(x1 + \left(\left(t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_5\right) + \left(t\_4 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_5\right)\right) + t\_0 \cdot t\_4\right) + x1 \cdot \left(x1 \cdot x1\right)\right)\right) + 3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_3}\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 3.0%
Simplified30.3%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x2 around 0 97.0%
if -5e102 < x1 < 5.00000000000000018e153Initial program 99.4%
if 5.00000000000000018e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (+ (* x1 x1) 1.0))
(t_1 (* x1 (* x1 3.0)))
(t_2 (- x1 (+ t_1 (* 2.0 x2))))
(t_3 (/ t_2 t_0))
(t_4 (- -1.0 (* x1 x1))))
(if (<= x1 -5e+102)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 5e+153)
(-
x1
(+
(* 3.0 (/ (- (- t_1 (* 2.0 x2)) x1) t_4))
(-
(-
(-
(*
t_0
(+
(* (* x1 x1) (+ 6.0 (* 4.0 t_3)))
(* (* (/ t_2 t_4) (* x1 2.0)) (+ 3.0 t_3))))
(* 3.0 t_1))
(* x1 (* x1 x1)))
x1)))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = (x1 * x1) + 1.0;
double t_1 = x1 * (x1 * 3.0);
double t_2 = x1 - (t_1 + (2.0 * x2));
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4)) + ((((t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((t_2 / t_4) * (x1 * 2.0)) * (3.0 + t_3)))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = (x1 * x1) + 1.0d0
t_1 = x1 * (x1 * 3.0d0)
t_2 = x1 - (t_1 + (2.0d0 * x2))
t_3 = t_2 / t_0
t_4 = (-1.0d0) - (x1 * x1)
if (x1 <= (-5d+102)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 - ((3.0d0 * (((t_1 - (2.0d0 * x2)) - x1) / t_4)) + ((((t_0 * (((x1 * x1) * (6.0d0 + (4.0d0 * t_3))) + (((t_2 / t_4) * (x1 * 2.0d0)) * (3.0d0 + t_3)))) - (3.0d0 * t_1)) - (x1 * (x1 * x1))) - x1))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.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 = x1 - (t_1 + (2.0 * x2));
double t_3 = t_2 / t_0;
double t_4 = -1.0 - (x1 * x1);
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4)) + ((((t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((t_2 / t_4) * (x1 * 2.0)) * (3.0 + t_3)))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = (x1 * x1) + 1.0 t_1 = x1 * (x1 * 3.0) t_2 = x1 - (t_1 + (2.0 * x2)) t_3 = t_2 / t_0 t_4 = -1.0 - (x1 * x1) tmp = 0 if x1 <= -5e+102: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= 5e+153: tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4)) + ((((t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((t_2 / t_4) * (x1 * 2.0)) * (3.0 + t_3)))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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(x1 - Float64(t_1 + Float64(2.0 * x2))) t_3 = Float64(t_2 / t_0) t_4 = Float64(-1.0 - Float64(x1 * x1)) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= 5e+153) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(t_1 - Float64(2.0 * x2)) - x1) / t_4)) + Float64(Float64(Float64(Float64(t_0 * Float64(Float64(Float64(x1 * x1) * Float64(6.0 + Float64(4.0 * t_3))) + Float64(Float64(Float64(t_2 / t_4) * Float64(x1 * 2.0)) * Float64(3.0 + t_3)))) - Float64(3.0 * t_1)) - Float64(x1 * Float64(x1 * x1))) - x1))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.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 = x1 - (t_1 + (2.0 * x2)); t_3 = t_2 / t_0; t_4 = -1.0 - (x1 * x1); tmp = 0.0; if (x1 <= -5e+102) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= 5e+153) tmp = x1 - ((3.0 * (((t_1 - (2.0 * x2)) - x1) / t_4)) + ((((t_0 * (((x1 * x1) * (6.0 + (4.0 * t_3))) + (((t_2 / t_4) * (x1 * 2.0)) * (3.0 + t_3)))) - (3.0 * t_1)) - (x1 * (x1 * x1))) - x1)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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[(x1 - N[(t$95$1 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 - N[(N[(3.0 * N[(N[(N[(t$95$1 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$0 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(6.0 + N[(4.0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$2 / t$95$4), $MachinePrecision] * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(3.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $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 := x1 - \left(t\_1 + 2 \cdot x2\right)\\
t_3 := \frac{t\_2}{t\_0}\\
t_4 := -1 - x1 \cdot x1\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_1 - 2 \cdot x2\right) - x1}{t\_4} + \left(\left(\left(t\_0 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(6 + 4 \cdot t\_3\right) + \left(\frac{t\_2}{t\_4} \cdot \left(x1 \cdot 2\right)\right) \cdot \left(3 + t\_3\right)\right) - 3 \cdot t\_1\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 3.0%
Simplified30.3%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x2 around 0 97.0%
if -5e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.2%
if 5.00000000000000018e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- x1 (+ t_0 (* 2.0 x2))))
(t_2 (- -1.0 (* x1 x1)))
(t_3 (/ t_1 t_2)))
(if (<= x1 -5e+102)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 5e+153)
(-
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(-
(-
(+
(* t_0 (/ t_1 (+ (* x1 x1) 1.0)))
(* (+ (* (* t_3 (* x1 2.0)) (- t_3 3.0)) (* (* x1 x1) 6.0)) t_2))
(* x1 (* x1 x1)))
x1)))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = t_1 / t_2;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 - ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + ((((t_0 * (t_1 / ((x1 * x1) + 1.0))) + ((((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)) * t_2)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 * 3.0d0)
t_1 = x1 - (t_0 + (2.0d0 * x2))
t_2 = (-1.0d0) - (x1 * x1)
t_3 = t_1 / t_2
if (x1 <= (-5d+102)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 - ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + ((((t_0 * (t_1 / ((x1 * x1) + 1.0d0))) + ((((t_3 * (x1 * 2.0d0)) * (t_3 - 3.0d0)) + ((x1 * x1) * 6.0d0)) * t_2)) - (x1 * (x1 * x1))) - x1))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = x1 - (t_0 + (2.0 * x2));
double t_2 = -1.0 - (x1 * x1);
double t_3 = t_1 / t_2;
double tmp;
if (x1 <= -5e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 - ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + ((((t_0 * (t_1 / ((x1 * x1) + 1.0))) + ((((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)) * t_2)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = x1 - (t_0 + (2.0 * x2)) t_2 = -1.0 - (x1 * x1) t_3 = t_1 / t_2 tmp = 0 if x1 <= -5e+102: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= 5e+153: tmp = x1 - ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + ((((t_0 * (t_1 / ((x1 * x1) + 1.0))) + ((((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)) * t_2)) - (x1 * (x1 * x1))) - x1)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) t_2 = Float64(-1.0 - Float64(x1 * x1)) t_3 = Float64(t_1 / t_2) tmp = 0.0 if (x1 <= -5e+102) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= 5e+153) tmp = Float64(x1 - Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(Float64(Float64(Float64(t_0 * Float64(t_1 / Float64(Float64(x1 * x1) + 1.0))) + Float64(Float64(Float64(Float64(t_3 * Float64(x1 * 2.0)) * Float64(t_3 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)) * t_2)) - Float64(x1 * Float64(x1 * x1))) - x1))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = x1 - (t_0 + (2.0 * x2)); t_2 = -1.0 - (x1 * x1); t_3 = t_1 / t_2; tmp = 0.0; if (x1 <= -5e+102) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= 5e+153) tmp = x1 - ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + ((((t_0 * (t_1 / ((x1 * x1) + 1.0))) + ((((t_3 * (x1 * 2.0)) * (t_3 - 3.0)) + ((x1 * x1) * 6.0)) * t_2)) - (x1 * (x1 * x1))) - x1)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, If[LessEqual[x1, -5e+102], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 - N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$0 * N[(t$95$1 / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(t$95$3 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$3 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := x1 - \left(t\_0 + 2 \cdot x2\right)\\
t_2 := -1 - x1 \cdot x1\\
t_3 := \frac{t\_1}{t\_2}\\
\mathbf{if}\;x1 \leq -5 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 - \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2} + \left(\left(\left(t\_0 \cdot \frac{t\_1}{x1 \cdot x1 + 1} + \left(\left(t\_3 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_3 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot t\_2\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5e102Initial program 3.0%
Simplified30.3%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x2 around 0 97.0%
if -5e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
if 5.00000000000000018e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (/ (- x1 (+ t_0 (* 2.0 x2))) (- -1.0 (* x1 x1))))
(t_2 (+ (* x1 x1) 1.0))
(t_3
(+
x1
(+
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_2))
(+
x1
(+
(* x1 (* x1 x1))
(+
(* t_0 t_1)
(* t_2 (+ (* (* x1 x1) (- (* t_1 4.0) 6.0)) -6.0)))))))))
(if (<= x1 -5.8e+102)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 -1.65e+18)
t_3
(if (<= x1 13000000.0)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 5e+153)
t_3
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 - (t_0 + (2.0 * x2))) / (-1.0 - (x1 * x1));
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + (t_2 * (((x1 * x1) * ((t_1 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= -1.65e+18) {
tmp = t_3;
} else if (x1 <= 13000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 * 3.0d0)
t_1 = (x1 - (t_0 + (2.0d0 * x2))) / ((-1.0d0) - (x1 * x1))
t_2 = (x1 * x1) + 1.0d0
t_3 = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + (t_2 * (((x1 * x1) * ((t_1 * 4.0d0) - 6.0d0)) + (-6.0d0)))))))
if (x1 <= (-5.8d+102)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= (-1.65d+18)) then
tmp = t_3
else if (x1 <= 13000000.0d0) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 5d+153) then
tmp = t_3
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 - (t_0 + (2.0 * x2))) / (-1.0 - (x1 * x1));
double t_2 = (x1 * x1) + 1.0;
double t_3 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + (t_2 * (((x1 * x1) * ((t_1 * 4.0) - 6.0)) + -6.0))))));
double tmp;
if (x1 <= -5.8e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= -1.65e+18) {
tmp = t_3;
} else if (x1 <= 13000000.0) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 5e+153) {
tmp = t_3;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 - (t_0 + (2.0 * x2))) / (-1.0 - (x1 * x1)) t_2 = (x1 * x1) + 1.0 t_3 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + (t_2 * (((x1 * x1) * ((t_1 * 4.0) - 6.0)) + -6.0)))))) tmp = 0 if x1 <= -5.8e+102: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= -1.65e+18: tmp = t_3 elif x1 <= 13000000.0: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 5e+153: tmp = t_3 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / Float64(-1.0 - Float64(x1 * x1))) t_2 = Float64(Float64(x1 * x1) + 1.0) t_3 = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_2)) + Float64(x1 + Float64(Float64(x1 * Float64(x1 * x1)) + Float64(Float64(t_0 * t_1) + Float64(t_2 * Float64(Float64(Float64(x1 * x1) * Float64(Float64(t_1 * 4.0) - 6.0)) + -6.0))))))) tmp = 0.0 if (x1 <= -5.8e+102) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= -1.65e+18) tmp = t_3; elseif (x1 <= 13000000.0) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 5e+153) tmp = t_3; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 - (t_0 + (2.0 * x2))) / (-1.0 - (x1 * x1)); t_2 = (x1 * x1) + 1.0; t_3 = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_2)) + (x1 + ((x1 * (x1 * x1)) + ((t_0 * t_1) + (t_2 * (((x1 * x1) * ((t_1 * 4.0) - 6.0)) + -6.0)))))); tmp = 0.0; if (x1 <= -5.8e+102) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= -1.65e+18) tmp = t_3; elseif (x1 <= 13000000.0) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 5e+153) tmp = t_3; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - 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$0 * t$95$1), $MachinePrecision] + N[(t$95$2 * N[(N[(N[(x1 * x1), $MachinePrecision] * N[(N[(t$95$1 * 4.0), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision] + -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -5.8e+102], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, -1.65e+18], t$95$3, If[LessEqual[x1, 13000000.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, 5e+153], t$95$3, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(x1 \cdot 3\right)\\
t_1 := \frac{x1 - \left(t\_0 + 2 \cdot x2\right)}{-1 - x1 \cdot x1}\\
t_2 := x1 \cdot x1 + 1\\
t_3 := x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_2} + \left(x1 + \left(x1 \cdot \left(x1 \cdot x1\right) + \left(t\_0 \cdot t\_1 + t\_2 \cdot \left(\left(x1 \cdot x1\right) \cdot \left(t\_1 \cdot 4 - 6\right) + -6\right)\right)\right)\right)\right)\\
\mathbf{if}\;x1 \leq -5.8 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -1.65 \cdot 10^{+18}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x1 \leq 13000000:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -5.8000000000000005e102Initial program 3.0%
Simplified30.3%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x2 around 0 97.0%
if -5.8000000000000005e102 < x1 < -1.65e18 or 1.3e7 < x1 < 5.00000000000000018e153Initial program 99.6%
fma-define99.6%
div-inv99.7%
associate-*r*99.7%
fma-define99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in x1 around 0 99.7%
add-cube-cbrt99.6%
Applied egg-rr99.6%
Taylor expanded in x1 around inf 90.3%
if -1.65e18 < x1 < 1.3e7Initial program 99.4%
Simplified86.6%
Taylor expanded in x1 around 0 83.6%
fma-define83.7%
associate-*r*83.7%
fmm-def83.7%
*-commutative83.7%
*-commutative83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in x2 around 0 96.8%
if 5.00000000000000018e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification96.0%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0)))
(t_1 (- -1.0 (* x1 x1)))
(t_2 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1)))
(if (<= x1 -4.2e+102)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 5e+153)
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(-
(-
(-
(* (+ (* (* t_2 (* x1 2.0)) (- t_2 3.0)) (* (* x1 x1) 6.0)) t_1)
(* 3.0 t_0))
(* x1 (* x1 x1)))
x1)))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = -1.0 - (x1 * x1);
double t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double tmp;
if (x1 <= -4.2e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) - (((((((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)) * t_1) - (3.0 * t_0)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x1 * (x1 * 3.0d0)
t_1 = (-1.0d0) - (x1 * x1)
t_2 = (x1 - (t_0 + (2.0d0 * x2))) / t_1
if (x1 <= (-4.2d+102)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= 5d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / ((x1 * x1) + 1.0d0))) - (((((((t_2 * (x1 * 2.0d0)) * (t_2 - 3.0d0)) + ((x1 * x1) * 6.0d0)) * t_1) - (3.0d0 * t_0)) - (x1 * (x1 * x1))) - x1))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.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 t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1;
double tmp;
if (x1 <= -4.2e+102) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) - (((((((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)) * t_1) - (3.0 * t_0)) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = -1.0 - (x1 * x1) t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1 tmp = 0 if x1 <= -4.2e+102: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= 5e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) - (((((((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)) * t_1) - (3.0 * t_0)) - (x1 * (x1 * x1))) - x1)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(-1.0 - Float64(x1 * x1)) t_2 = Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1) tmp = 0.0 if (x1 <= -4.2e+102) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= 5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / Float64(Float64(x1 * x1) + 1.0))) - Float64(Float64(Float64(Float64(Float64(Float64(Float64(t_2 * Float64(x1 * 2.0)) * Float64(t_2 - 3.0)) + Float64(Float64(x1 * x1) * 6.0)) * t_1) - Float64(3.0 * t_0)) - Float64(x1 * Float64(x1 * x1))) - x1))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = -1.0 - (x1 * x1); t_2 = (x1 - (t_0 + (2.0 * x2))) / t_1; tmp = 0.0; if (x1 <= -4.2e+102) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= 5e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) - (((((((t_2 * (x1 * 2.0)) * (t_2 - 3.0)) + ((x1 * x1) * 6.0)) * t_1) - (3.0 * t_0)) - (x1 * (x1 * x1))) - x1)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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]}, Block[{t$95$2 = N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[x1, -4.2e+102], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / N[(N[(x1 * x1), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(N[(N[(N[(t$95$2 * N[(x1 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 - 3.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x1 * x1), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(3.0 * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $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\\
t_2 := \frac{x1 - \left(t\_0 + 2 \cdot x2\right)}{t\_1}\\
\mathbf{if}\;x1 \leq -4.2 \cdot 10^{+102}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - \left(\left(\left(\left(\left(t\_2 \cdot \left(x1 \cdot 2\right)\right) \cdot \left(t\_2 - 3\right) + \left(x1 \cdot x1\right) \cdot 6\right) \cdot t\_1 - 3 \cdot t\_0\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -4.20000000000000003e102Initial program 3.0%
Simplified30.3%
Taylor expanded in x1 around 0 69.7%
Taylor expanded in x2 around 0 97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in x2 around 0 97.0%
if -4.20000000000000003e102 < x1 < 5.00000000000000018e153Initial program 99.4%
Taylor expanded in x1 around inf 98.0%
Taylor expanded in x1 around inf 98.0%
if 5.00000000000000018e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification98.2%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (* x1 3.0))) (t_1 (+ (* x1 x1) 1.0)))
(if (<= x1 -2.2e+60)
(* x2 (- (/ (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))) x2) 6.0))
(if (<= x1 5e-25)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(if (<= x1 4.5e+153)
(+
x1
(-
(* 3.0 (/ (- (- t_0 (* 2.0 x2)) x1) t_1))
(-
(-
(+
(* t_0 (/ (- x1 (+ t_0 (* 2.0 x2))) t_1))
(* t_1 (* 4.0 (* x1 (* x2 (- 3.0 (* 2.0 x2)))))))
(* x1 (* x1 x1)))
x1)))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))))
double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -2.2e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 5e-25) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)) + (t_1 * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 = (x1 * x1) + 1.0d0
if (x1 <= (-2.2d+60)) then
tmp = x2 * (((x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))) / x2) - 6.0d0)
else if (x1 <= 5d-25) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else if (x1 <= 4.5d+153) then
tmp = x1 + ((3.0d0 * (((t_0 - (2.0d0 * x2)) - x1) / t_1)) - ((((t_0 * ((x1 - (t_0 + (2.0d0 * x2))) / t_1)) + (t_1 * (4.0d0 * (x1 * (x2 * (3.0d0 - (2.0d0 * x2))))))) - (x1 * (x1 * x1))) - x1))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (x1 * 3.0);
double t_1 = (x1 * x1) + 1.0;
double tmp;
if (x1 <= -2.2e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 5e-25) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else if (x1 <= 4.5e+153) {
tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)) + (t_1 * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))) - (x1 * (x1 * x1))) - x1));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (x1 * 3.0) t_1 = (x1 * x1) + 1.0 tmp = 0 if x1 <= -2.2e+60: tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0) elif x1 <= 5e-25: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 elif x1 <= 4.5e+153: tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)) + (t_1 * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))) - (x1 * (x1 * x1))) - x1)) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(x1 * 3.0)) t_1 = Float64(Float64(x1 * x1) + 1.0) tmp = 0.0 if (x1 <= -2.2e+60) tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))) / x2) - 6.0)); elseif (x1 <= 5e-25) tmp = Float64(Float64(x2 * Float64(Float64(Float64(x1 * -12.0) + Float64(8.0 * Float64(x1 * x2))) - 6.0)) - x1); elseif (x1 <= 4.5e+153) tmp = Float64(x1 + Float64(Float64(3.0 * Float64(Float64(Float64(t_0 - Float64(2.0 * x2)) - x1) / t_1)) - Float64(Float64(Float64(Float64(t_0 * Float64(Float64(x1 - Float64(t_0 + Float64(2.0 * x2))) / t_1)) + Float64(t_1 * Float64(4.0 * Float64(x1 * Float64(x2 * Float64(3.0 - Float64(2.0 * x2))))))) - Float64(x1 * Float64(x1 * x1))) - x1))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (x1 * 3.0); t_1 = (x1 * x1) + 1.0; tmp = 0.0; if (x1 <= -2.2e+60) tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0); elseif (x1 <= 5e-25) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; elseif (x1 <= 4.5e+153) tmp = x1 + ((3.0 * (((t_0 - (2.0 * x2)) - x1) / t_1)) - ((((t_0 * ((x1 - (t_0 + (2.0 * x2))) / t_1)) + (t_1 * (4.0 * (x1 * (x2 * (3.0 - (2.0 * x2))))))) - (x1 * (x1 * x1))) - x1)); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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]}, If[LessEqual[x1, -2.2e+60], N[(x2 * N[(N[(N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 5e-25], 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, 4.5e+153], N[(x1 + N[(N[(3.0 * N[(N[(N[(t$95$0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * N[(N[(x1 - N[(t$95$0 + N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(4.0 * N[(x1 * N[(x2 * N[(3.0 - N[(2.0 * x2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x1 * N[(x1 * x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.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\\
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+60}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 5 \cdot 10^{-25}:\\
\;\;\;\;x2 \cdot \left(\left(x1 \cdot -12 + 8 \cdot \left(x1 \cdot x2\right)\right) - 6\right) - x1\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x1 + \left(3 \cdot \frac{\left(t\_0 - 2 \cdot x2\right) - x1}{t\_1} - \left(\left(\left(t\_0 \cdot \frac{x1 - \left(t\_0 + 2 \cdot x2\right)}{t\_1} + t\_1 \cdot \left(4 \cdot \left(x1 \cdot \left(x2 \cdot \left(3 - 2 \cdot x2\right)\right)\right)\right)\right) - x1 \cdot \left(x1 \cdot x1\right)\right) - x1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.19999999999999996e60Initial program 27.1%
Simplified47.6%
Taylor expanded in x1 around 0 54.0%
Taylor expanded in x2 around 0 74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in x2 around inf 87.0%
if -2.19999999999999996e60 < x1 < 4.99999999999999962e-25Initial program 99.4%
Simplified86.1%
Taylor expanded in x1 around 0 82.9%
fma-define83.0%
associate-*r*83.0%
fmm-def83.0%
*-commutative83.0%
*-commutative83.0%
metadata-eval83.0%
Simplified83.0%
Taylor expanded in x2 around 0 96.6%
if 4.99999999999999962e-25 < x1 < 4.5000000000000001e153Initial program 99.4%
Taylor expanded in x1 around 0 43.6%
Taylor expanded in x1 around 0 61.2%
if 4.5000000000000001e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification89.1%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.8e+88)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (or (<= x1 -6.8e-171) (and (not (<= x1 2.1e-100)) (<= x1 3.5e+153)))
(* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0)))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if ((x1 <= -6.8e-171) || (!(x1 <= 2.1e-100) && (x1 <= 3.5e+153))) {
tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.8d+88)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if ((x1 <= (-6.8d-171)) .or. (.not. (x1 <= 2.1d-100)) .and. (x1 <= 3.5d+153)) then
tmp = x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if ((x1 <= -6.8e-171) || (!(x1 <= 2.1e-100) && (x1 <= 3.5e+153))) {
tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.8e+88: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif (x1 <= -6.8e-171) or (not (x1 <= 2.1e-100) and (x1 <= 3.5e+153)): tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+88) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif ((x1 <= -6.8e-171) || (!(x1 <= 2.1e-100) && (x1 <= 3.5e+153))) tmp = Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.8e+88) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif ((x1 <= -6.8e-171) || (~((x1 <= 2.1e-100)) && (x1 <= 3.5e+153))) tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+88], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -6.8e-171], And[N[Not[LessEqual[x1, 2.1e-100]], $MachinePrecision], LessEqual[x1, 3.5e+153]]], N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -6.8 \cdot 10^{-171} \lor \neg \left(x1 \leq 2.1 \cdot 10^{-100}\right) \land x1 \leq 3.5 \cdot 10^{+153}:\\
\;\;\;\;x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.7999999999999997e88Initial program 17.9%
Simplified41.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x2 around 0 83.3%
if -3.7999999999999997e88 < x1 < -6.7999999999999997e-171 or 2.10000000000000009e-100 < x1 < 3.4999999999999999e153Initial program 99.3%
Simplified92.8%
Taylor expanded in x1 around 0 66.3%
fma-define66.3%
associate-*r*66.3%
fmm-def66.3%
*-commutative66.3%
*-commutative66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in x2 around 0 71.4%
Taylor expanded in x1 around inf 56.4%
if -6.7999999999999997e-171 < x1 < 2.10000000000000009e-100 or 3.4999999999999999e153 < x1 Initial program 60.9%
Simplified50.5%
Taylor expanded in x1 around 0 46.2%
Taylor expanded in x2 around 0 51.7%
*-commutative51.7%
Simplified51.7%
Taylor expanded in x1 around 0 91.5%
*-commutative91.5%
Simplified91.5%
Final simplification75.3%
(FPCore (x1 x2)
:precision binary64
(let* ((t_0 (* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0))))))
(t_1 (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))))
(if (<= x1 -3.6e+88)
t_1
(if (<= x1 -6.2e-171)
t_0
(if (<= x1 5.4e-101)
(+ t_1 (* x2 -6.0))
(if (<= x1 4.5e+153)
t_0
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0))))))))))
double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
double t_1 = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
double tmp;
if (x1 <= -3.6e+88) {
tmp = t_1;
} else if (x1 <= -6.2e-171) {
tmp = t_0;
} else if (x1 <= 5.4e-101) {
tmp = t_1 + (x2 * -6.0);
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.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 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0))))
t_1 = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
if (x1 <= (-3.6d+88)) then
tmp = t_1
else if (x1 <= (-6.2d-171)) then
tmp = t_0
else if (x1 <= 5.4d-101) then
tmp = t_1 + (x2 * (-6.0d0))
else if (x1 <= 4.5d+153) then
tmp = t_0
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double t_0 = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
double t_1 = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
double tmp;
if (x1 <= -3.6e+88) {
tmp = t_1;
} else if (x1 <= -6.2e-171) {
tmp = t_0;
} else if (x1 <= 5.4e-101) {
tmp = t_1 + (x2 * -6.0);
} else if (x1 <= 4.5e+153) {
tmp = t_0;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): t_0 = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))) t_1 = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) tmp = 0 if x1 <= -3.6e+88: tmp = t_1 elif x1 <= -6.2e-171: tmp = t_0 elif x1 <= 5.4e-101: tmp = t_1 + (x2 * -6.0) elif x1 <= 4.5e+153: tmp = t_0 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) t_0 = Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))))) t_1 = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))) tmp = 0.0 if (x1 <= -3.6e+88) tmp = t_1; elseif (x1 <= -6.2e-171) tmp = t_0; elseif (x1 <= 5.4e-101) tmp = Float64(t_1 + Float64(x2 * -6.0)); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) t_0 = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))); t_1 = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); tmp = 0.0; if (x1 <= -3.6e+88) tmp = t_1; elseif (x1 <= -6.2e-171) tmp = t_0; elseif (x1 <= 5.4e-101) tmp = t_1 + (x2 * -6.0); elseif (x1 <= 4.5e+153) tmp = t_0; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := Block[{t$95$0 = N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x1, -3.6e+88], t$95$1, If[LessEqual[x1, -6.2e-171], t$95$0, If[LessEqual[x1, 5.4e-101], N[(t$95$1 + N[(x2 * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], t$95$0, N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
t_1 := x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{if}\;x1 \leq -3.6 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x1 \leq -6.2 \cdot 10^{-171}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x1 \leq 5.4 \cdot 10^{-101}:\\
\;\;\;\;t\_1 + x2 \cdot -6\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.6000000000000002e88Initial program 17.9%
Simplified41.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x2 around 0 83.3%
if -3.6000000000000002e88 < x1 < -6.2000000000000001e-171 or 5.4000000000000003e-101 < x1 < 4.5000000000000001e153Initial program 99.3%
Simplified92.8%
Taylor expanded in x1 around 0 66.3%
fma-define66.3%
associate-*r*66.3%
fmm-def66.3%
*-commutative66.3%
*-commutative66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in x2 around 0 71.4%
Taylor expanded in x1 around inf 56.4%
if -6.2000000000000001e-171 < x1 < 5.4000000000000003e-101Initial program 99.6%
Simplified82.3%
Taylor expanded in x1 around 0 76.8%
Taylor expanded in x2 around 0 85.8%
*-commutative85.8%
Simplified85.8%
if 4.5000000000000001e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification75.3%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.8e+88)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (or (<= x1 -1.3e-176) (not (<= x1 8.2e-101)))
(* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0)))))
(- (* x2 -6.0) x1))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if ((x1 <= -1.3e-176) || !(x1 <= 8.2e-101)) {
tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.8d+88)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if ((x1 <= (-1.3d-176)) .or. (.not. (x1 <= 8.2d-101))) then
tmp = x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if ((x1 <= -1.3e-176) || !(x1 <= 8.2e-101)) {
tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.8e+88: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif (x1 <= -1.3e-176) or not (x1 <= 8.2e-101): tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+88) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif ((x1 <= -1.3e-176) || !(x1 <= 8.2e-101)) tmp = Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.8e+88) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif ((x1 <= -1.3e-176) || ~((x1 <= 8.2e-101))) tmp = x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+88], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x1, -1.3e-176], N[Not[LessEqual[x1, 8.2e-101]], $MachinePrecision]], N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq -1.3 \cdot 10^{-176} \lor \neg \left(x1 \leq 8.2 \cdot 10^{-101}\right):\\
\;\;\;\;x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -3.7999999999999997e88Initial program 17.9%
Simplified41.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x2 around 0 83.3%
if -3.7999999999999997e88 < x1 < -1.29999999999999996e-176 or 8.20000000000000052e-101 < x1 Initial program 71.9%
Simplified67.2%
Taylor expanded in x1 around 0 61.5%
fma-define61.6%
associate-*r*61.6%
fmm-def61.6%
*-commutative61.6%
*-commutative61.6%
metadata-eval61.6%
Simplified61.6%
Taylor expanded in x2 around 0 64.5%
Taylor expanded in x1 around inf 54.4%
if -1.29999999999999996e-176 < x1 < 8.20000000000000052e-101Initial program 99.6%
Simplified82.3%
Taylor expanded in x1 around 0 76.8%
Taylor expanded in x2 around 0 85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in x1 around 0 85.8%
mul-1-neg85.8%
unsub-neg85.8%
*-commutative85.8%
Simplified85.8%
Final simplification66.8%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.15e+60)
(* x2 (- (/ (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))) x2) 6.0))
(if (<= x1 4.5e+153)
(- (* x2 (- (+ (* x1 -12.0) (* 8.0 (* x1 x2))) 6.0)) x1)
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.15e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 4.5e+153) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.15d+60)) then
tmp = x2 * (((x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))) / x2) - 6.0d0)
else if (x1 <= 4.5d+153) then
tmp = (x2 * (((x1 * (-12.0d0)) + (8.0d0 * (x1 * x2))) - 6.0d0)) - x1
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.15e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 4.5e+153) {
tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1;
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.15e+60: tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0) elif x1 <= 4.5e+153: tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1 else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.15e+60) tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))) / x2) - 6.0)); elseif (x1 <= 4.5e+153) 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(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.15e+60) tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0); elseif (x1 <= 4.5e+153) tmp = (x2 * (((x1 * -12.0) + (8.0 * (x1 * x2))) - 6.0)) - x1; else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.15e+60], N[(x2 * N[(N[(N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], 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[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.15 \cdot 10^{+60}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;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 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.14999999999999986e60Initial program 27.1%
Simplified47.6%
Taylor expanded in x1 around 0 54.0%
Taylor expanded in x2 around 0 74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in x2 around inf 87.0%
if -2.14999999999999986e60 < x1 < 4.5000000000000001e153Initial program 99.4%
Simplified88.6%
Taylor expanded in x1 around 0 73.8%
fma-define73.8%
associate-*r*73.8%
fmm-def73.8%
*-commutative73.8%
*-commutative73.8%
metadata-eval73.8%
Simplified73.8%
Taylor expanded in x2 around 0 83.7%
if 4.5000000000000001e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification87.0%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -2.2e+60)
(* x2 (- (/ (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))) x2) 6.0))
(if (<= x1 4.5e+153)
(+ (* x2 -6.0) (* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-2.2d+60)) then
tmp = x2 * (((x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))) / x2) - 6.0d0)
else if (x1 <= 4.5d+153) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0)))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -2.2e+60) {
tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0);
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -2.2e+60: tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0) elif x1 <= 4.5e+153: tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -2.2e+60) tmp = Float64(x2 * Float64(Float64(Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))) / x2) - 6.0)); elseif (x1 <= 4.5e+153) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0)))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -2.2e+60) tmp = x2 * (((x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))))) / x2) - 6.0); elseif (x1 <= 4.5e+153) tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -2.2e+60], N[(x2 * N[(N[(N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x2), $MachinePrecision] - 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -2.2 \cdot 10^{+60}:\\
\;\;\;\;x2 \cdot \left(\frac{x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)}{x2} - 6\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -2.19999999999999996e60Initial program 27.1%
Simplified47.6%
Taylor expanded in x1 around 0 54.0%
Taylor expanded in x2 around 0 74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in x2 around inf 87.0%
if -2.19999999999999996e60 < x1 < 4.5000000000000001e153Initial program 99.4%
Simplified88.6%
Taylor expanded in x1 around 0 73.8%
fma-define73.8%
associate-*r*73.8%
fmm-def73.8%
*-commutative73.8%
*-commutative73.8%
metadata-eval73.8%
Simplified73.8%
Taylor expanded in x2 around 0 83.8%
Taylor expanded in x1 around 0 73.8%
if 4.5000000000000001e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification80.4%
(FPCore (x1 x2)
:precision binary64
(if (<= x1 -3.8e+88)
(* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0)))))
(if (<= x1 4.5e+153)
(+ (* x2 -6.0) (* x1 (- -1.0 (* x2 (- 12.0 (* x2 8.0))))))
(+ (* x2 -6.0) (* x1 (+ -1.0 (* x1 9.0)))))))
double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-3.8d+88)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else if (x1 <= 4.5d+153) then
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) - (x2 * (12.0d0 - (x2 * 8.0d0)))))
else
tmp = (x2 * (-6.0d0)) + (x1 * ((-1.0d0) + (x1 * 9.0d0)))
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -3.8e+88) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else if (x1 <= 4.5e+153) {
tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0)))));
} else {
tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0)));
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -3.8e+88: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) elif x1 <= 4.5e+153: tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))) else: tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))) return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -3.8e+88) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); elseif (x1 <= 4.5e+153) tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 - Float64(x2 * Float64(12.0 - Float64(x2 * 8.0)))))); else tmp = Float64(Float64(x2 * -6.0) + Float64(x1 * Float64(-1.0 + Float64(x1 * 9.0)))); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -3.8e+88) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); elseif (x1 <= 4.5e+153) tmp = (x2 * -6.0) + (x1 * (-1.0 - (x2 * (12.0 - (x2 * 8.0))))); else tmp = (x2 * -6.0) + (x1 * (-1.0 + (x1 * 9.0))); end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -3.8e+88], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x1, 4.5e+153], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 - N[(x2 * N[(12.0 - N[(x2 * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] + N[(x1 * N[(-1.0 + N[(x1 * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{elif}\;x1 \leq 4.5 \cdot 10^{+153}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 - x2 \cdot \left(12 - x2 \cdot 8\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 + x1 \cdot \left(-1 + x1 \cdot 9\right)\\
\end{array}
\end{array}
if x1 < -3.7999999999999997e88Initial program 17.9%
Simplified41.0%
Taylor expanded in x1 around 0 60.3%
Taylor expanded in x2 around 0 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in x2 around 0 83.3%
if -3.7999999999999997e88 < x1 < 4.5000000000000001e153Initial program 99.4%
Simplified88.9%
Taylor expanded in x1 around 0 72.3%
fma-define72.4%
associate-*r*72.4%
fmm-def72.4%
*-commutative72.4%
*-commutative72.4%
metadata-eval72.4%
Simplified72.4%
Taylor expanded in x2 around 0 82.1%
Taylor expanded in x1 around 0 72.3%
if 4.5000000000000001e153 < x1 Initial program 2.3%
Simplified2.3%
Taylor expanded in x1 around 0 0.0%
Taylor expanded in x2 around 0 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x1 around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification78.6%
(FPCore (x1 x2) :precision binary64 (if (<= x1 -1.1e-14) (* x1 (+ -1.0 (* x1 (+ 9.0 (* x1 -19.0))))) (- (* x2 -6.0) x1)))
double code(double x1, double x2) {
double tmp;
if (x1 <= -1.1e-14) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if (x1 <= (-1.1d-14)) then
tmp = x1 * ((-1.0d0) + (x1 * (9.0d0 + (x1 * (-19.0d0)))))
else
tmp = (x2 * (-6.0d0)) - x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if (x1 <= -1.1e-14) {
tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0))));
} else {
tmp = (x2 * -6.0) - x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if x1 <= -1.1e-14: tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))) else: tmp = (x2 * -6.0) - x1 return tmp
function code(x1, x2) tmp = 0.0 if (x1 <= -1.1e-14) tmp = Float64(x1 * Float64(-1.0 + Float64(x1 * Float64(9.0 + Float64(x1 * -19.0))))); else tmp = Float64(Float64(x2 * -6.0) - x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if (x1 <= -1.1e-14) tmp = x1 * (-1.0 + (x1 * (9.0 + (x1 * -19.0)))); else tmp = (x2 * -6.0) - x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[LessEqual[x1, -1.1e-14], N[(x1 * N[(-1.0 + N[(x1 * N[(9.0 + N[(x1 * -19.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x1 \leq -1.1 \cdot 10^{-14}:\\
\;\;\;\;x1 \cdot \left(-1 + x1 \cdot \left(9 + x1 \cdot -19\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x2 \cdot -6 - x1\\
\end{array}
\end{array}
if x1 < -1.1e-14Initial program 39.5%
Simplified56.4%
Taylor expanded in x1 around 0 47.0%
Taylor expanded in x2 around 0 64.3%
*-commutative64.3%
Simplified64.3%
Taylor expanded in x2 around 0 64.1%
if -1.1e-14 < x1 Initial program 78.9%
Simplified69.8%
Taylor expanded in x1 around 0 42.3%
Taylor expanded in x2 around 0 40.8%
*-commutative40.8%
Simplified40.8%
Taylor expanded in x1 around 0 40.8%
mul-1-neg40.8%
unsub-neg40.8%
*-commutative40.8%
Simplified40.8%
Final simplification45.6%
(FPCore (x1 x2) :precision binary64 (if (or (<= x2 -7.2e-123) (not (<= x2 6e-201))) (* x2 -6.0) (- x1)))
double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.2e-123) || !(x2 <= 6e-201)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
real(8) :: tmp
if ((x2 <= (-7.2d-123)) .or. (.not. (x2 <= 6d-201))) then
tmp = x2 * (-6.0d0)
else
tmp = -x1
end if
code = tmp
end function
public static double code(double x1, double x2) {
double tmp;
if ((x2 <= -7.2e-123) || !(x2 <= 6e-201)) {
tmp = x2 * -6.0;
} else {
tmp = -x1;
}
return tmp;
}
def code(x1, x2): tmp = 0 if (x2 <= -7.2e-123) or not (x2 <= 6e-201): tmp = x2 * -6.0 else: tmp = -x1 return tmp
function code(x1, x2) tmp = 0.0 if ((x2 <= -7.2e-123) || !(x2 <= 6e-201)) tmp = Float64(x2 * -6.0); else tmp = Float64(-x1); end return tmp end
function tmp_2 = code(x1, x2) tmp = 0.0; if ((x2 <= -7.2e-123) || ~((x2 <= 6e-201))) tmp = x2 * -6.0; else tmp = -x1; end tmp_2 = tmp; end
code[x1_, x2_] := If[Or[LessEqual[x2, -7.2e-123], N[Not[LessEqual[x2, 6e-201]], $MachinePrecision]], N[(x2 * -6.0), $MachinePrecision], (-x1)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x2 \leq -7.2 \cdot 10^{-123} \lor \neg \left(x2 \leq 6 \cdot 10^{-201}\right):\\
\;\;\;\;x2 \cdot -6\\
\mathbf{else}:\\
\;\;\;\;-x1\\
\end{array}
\end{array}
if x2 < -7.1999999999999994e-123 or 6.00000000000000004e-201 < x2 Initial program 71.5%
Simplified71.5%
Taylor expanded in x1 around 0 27.3%
*-commutative27.3%
Simplified27.3%
if -7.1999999999999994e-123 < x2 < 6.00000000000000004e-201Initial program 68.1%
Simplified70.4%
Taylor expanded in x1 around 0 45.1%
fma-define45.1%
associate-*r*45.1%
fmm-def45.1%
*-commutative45.1%
*-commutative45.1%
metadata-eval45.1%
Simplified45.1%
Taylor expanded in x2 around 0 37.4%
mul-1-neg37.4%
Simplified37.4%
Final simplification29.7%
(FPCore (x1 x2) :precision binary64 (- (* x2 -6.0) x1))
double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = (x2 * (-6.0d0)) - x1
end function
public static double code(double x1, double x2) {
return (x2 * -6.0) - x1;
}
def code(x1, x2): return (x2 * -6.0) - x1
function code(x1, x2) return Float64(Float64(x2 * -6.0) - x1) end
function tmp = code(x1, x2) tmp = (x2 * -6.0) - x1; end
code[x1_, x2_] := N[(N[(x2 * -6.0), $MachinePrecision] - x1), $MachinePrecision]
\begin{array}{l}
\\
x2 \cdot -6 - x1
\end{array}
Initial program 70.7%
Simplified67.1%
Taylor expanded in x1 around 0 43.3%
Taylor expanded in x2 around 0 45.7%
*-commutative45.7%
Simplified45.7%
Taylor expanded in x1 around 0 33.6%
mul-1-neg33.6%
unsub-neg33.6%
*-commutative33.6%
Simplified33.6%
(FPCore (x1 x2) :precision binary64 (- x1))
double code(double x1, double x2) {
return -x1;
}
real(8) function code(x1, x2)
real(8), intent (in) :: x1
real(8), intent (in) :: x2
code = -x1
end function
public static double code(double x1, double x2) {
return -x1;
}
def code(x1, x2): return -x1
function code(x1, x2) return Float64(-x1) end
function tmp = code(x1, x2) tmp = -x1; end
code[x1_, x2_] := (-x1)
\begin{array}{l}
\\
-x1
\end{array}
Initial program 70.7%
Simplified67.1%
Taylor expanded in x1 around 0 58.4%
fma-define58.4%
associate-*r*58.4%
fmm-def58.4%
*-commutative58.4%
*-commutative58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in x2 around 0 12.6%
mul-1-neg12.6%
Simplified12.6%
herbie shell --seed 2024177
(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))))))