
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
return Math.exp(-(1.0 - (x * x)));
}
def code(x): return math.exp(-(1.0 - (x * x)))
function code(x) return exp(Float64(-Float64(1.0 - Float64(x * x)))) end
function tmp = code(x) tmp = exp(-(1.0 - (x * x))); end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\left(1 - x \cdot x\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
return Math.exp(-(1.0 - (x * x)));
}
def code(x): return math.exp(-(1.0 - (x * x)))
function code(x) return exp(Float64(-Float64(1.0 - Float64(x * x)))) end
function tmp = code(x) tmp = exp(-(1.0 - (x * x))); end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
e^{-\left(1 - x \cdot x\right)}
\end{array}
(FPCore (x) :precision binary64 (exp (+ (* x x) -1.0)))
double code(double x) {
return exp(((x * x) + -1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = exp(((x * x) + (-1.0d0)))
end function
public static double code(double x) {
return Math.exp(((x * x) + -1.0));
}
def code(x): return math.exp(((x * x) + -1.0))
function code(x) return exp(Float64(Float64(x * x) + -1.0)) end
function tmp = code(x) tmp = exp(((x * x) + -1.0)); end
code[x_] := N[Exp[N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{x \cdot x + -1}
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (* (* x x) 0.5)) (t_1 (* (* x x) (- -1.0 t_0))) (t_2 (+ 1.0 t_0)))
(if (<= (* x x) 5e-8)
(/
(/
(+ 1.0 (* (* x t_2) (* (* t_2 (* x (* x x))) (* t_2 (* (* x x) t_1)))))
(* (+ 1.0 (* t_2 (* (* x x) (* (* x x) t_2)))) (+ 1.0 t_1)))
E)
(exp (* x x)))))
double code(double x) {
double t_0 = (x * x) * 0.5;
double t_1 = (x * x) * (-1.0 - t_0);
double t_2 = 1.0 + t_0;
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((1.0 + ((x * t_2) * ((t_2 * (x * (x * x))) * (t_2 * ((x * x) * t_1))))) / ((1.0 + (t_2 * ((x * x) * ((x * x) * t_2)))) * (1.0 + t_1))) / ((double) M_E);
} else {
tmp = exp((x * x));
}
return tmp;
}
public static double code(double x) {
double t_0 = (x * x) * 0.5;
double t_1 = (x * x) * (-1.0 - t_0);
double t_2 = 1.0 + t_0;
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((1.0 + ((x * t_2) * ((t_2 * (x * (x * x))) * (t_2 * ((x * x) * t_1))))) / ((1.0 + (t_2 * ((x * x) * ((x * x) * t_2)))) * (1.0 + t_1))) / Math.E;
} else {
tmp = Math.exp((x * x));
}
return tmp;
}
def code(x): t_0 = (x * x) * 0.5 t_1 = (x * x) * (-1.0 - t_0) t_2 = 1.0 + t_0 tmp = 0 if (x * x) <= 5e-8: tmp = ((1.0 + ((x * t_2) * ((t_2 * (x * (x * x))) * (t_2 * ((x * x) * t_1))))) / ((1.0 + (t_2 * ((x * x) * ((x * x) * t_2)))) * (1.0 + t_1))) / math.e else: tmp = math.exp((x * x)) return tmp
function code(x) t_0 = Float64(Float64(x * x) * 0.5) t_1 = Float64(Float64(x * x) * Float64(-1.0 - t_0)) t_2 = Float64(1.0 + t_0) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * t_2) * Float64(Float64(t_2 * Float64(x * Float64(x * x))) * Float64(t_2 * Float64(Float64(x * x) * t_1))))) / Float64(Float64(1.0 + Float64(t_2 * Float64(Float64(x * x) * Float64(Float64(x * x) * t_2)))) * Float64(1.0 + t_1))) / exp(1)); else tmp = exp(Float64(x * x)); end return tmp end
function tmp_2 = code(x) t_0 = (x * x) * 0.5; t_1 = (x * x) * (-1.0 - t_0); t_2 = 1.0 + t_0; tmp = 0.0; if ((x * x) <= 5e-8) tmp = ((1.0 + ((x * t_2) * ((t_2 * (x * (x * x))) * (t_2 * ((x * x) * t_1))))) / ((1.0 + (t_2 * ((x * x) * ((x * x) * t_2)))) * (1.0 + t_1))) / 2.71828182845904523536; else tmp = exp((x * x)); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + t$95$0), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(N[(1.0 + N[(N[(x * t$95$2), $MachinePrecision] * N[(N[(t$95$2 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(t$95$2 * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot 0.5\\
t_1 := \left(x \cdot x\right) \cdot \left(-1 - t\_0\right)\\
t_2 := 1 + t\_0\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{1 + \left(x \cdot t\_2\right) \cdot \left(\left(t\_2 \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(t\_2 \cdot \left(\left(x \cdot x\right) \cdot t\_1\right)\right)\right)}{\left(1 + t\_2 \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot t\_2\right)\right)\right) \cdot \left(1 + t\_1\right)}}{e}\\
\mathbf{else}:\\
\;\;\;\;e^{x \cdot x}\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification99.7%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x)))
(t_1 (* (* x x) 0.5))
(t_2 (* (* x x) (- -1.0 t_1)))
(t_3 (+ 1.0 t_1))
(t_4 (* x t_1)))
(if (<= (* x x) 2e+45)
(/
(/
(+ 1.0 (* (* x t_3) (* (* t_3 t_0) (* t_3 (* (* x x) t_2)))))
(* (+ 1.0 (* t_3 (* (* x x) (* (* x x) t_3)))) (+ 1.0 t_2)))
E)
(if (<= (* x x) 5e+102)
(/
(+
1.0
(/
(* x (+ t_0 (* t_0 (* (* (* x x) (* (* x x) (* x x))) 0.125))))
(+ (* x x) (* t_4 (- t_4 x)))))
E)
(+
1.0
(*
(* x x)
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666))))))))))
double code(double x) {
double t_0 = x * (x * x);
double t_1 = (x * x) * 0.5;
double t_2 = (x * x) * (-1.0 - t_1);
double t_3 = 1.0 + t_1;
double t_4 = x * t_1;
double tmp;
if ((x * x) <= 2e+45) {
tmp = ((1.0 + ((x * t_3) * ((t_3 * t_0) * (t_3 * ((x * x) * t_2))))) / ((1.0 + (t_3 * ((x * x) * ((x * x) * t_3)))) * (1.0 + t_2))) / ((double) M_E);
} else if ((x * x) <= 5e+102) {
tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_4 * (t_4 - x))))) / ((double) M_E);
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * x);
double t_1 = (x * x) * 0.5;
double t_2 = (x * x) * (-1.0 - t_1);
double t_3 = 1.0 + t_1;
double t_4 = x * t_1;
double tmp;
if ((x * x) <= 2e+45) {
tmp = ((1.0 + ((x * t_3) * ((t_3 * t_0) * (t_3 * ((x * x) * t_2))))) / ((1.0 + (t_3 * ((x * x) * ((x * x) * t_3)))) * (1.0 + t_2))) / Math.E;
} else if ((x * x) <= 5e+102) {
tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_4 * (t_4 - x))))) / Math.E;
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
def code(x): t_0 = x * (x * x) t_1 = (x * x) * 0.5 t_2 = (x * x) * (-1.0 - t_1) t_3 = 1.0 + t_1 t_4 = x * t_1 tmp = 0 if (x * x) <= 2e+45: tmp = ((1.0 + ((x * t_3) * ((t_3 * t_0) * (t_3 * ((x * x) * t_2))))) / ((1.0 + (t_3 * ((x * x) * ((x * x) * t_3)))) * (1.0 + t_2))) / math.e elif (x * x) <= 5e+102: tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_4 * (t_4 - x))))) / math.e else: tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))) return tmp
function code(x) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(Float64(x * x) * 0.5) t_2 = Float64(Float64(x * x) * Float64(-1.0 - t_1)) t_3 = Float64(1.0 + t_1) t_4 = Float64(x * t_1) tmp = 0.0 if (Float64(x * x) <= 2e+45) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * t_3) * Float64(Float64(t_3 * t_0) * Float64(t_3 * Float64(Float64(x * x) * t_2))))) / Float64(Float64(1.0 + Float64(t_3 * Float64(Float64(x * x) * Float64(Float64(x * x) * t_3)))) * Float64(1.0 + t_2))) / exp(1)); elseif (Float64(x * x) <= 5e+102) tmp = Float64(Float64(1.0 + Float64(Float64(x * Float64(t_0 + Float64(t_0 * Float64(Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(x * x))) * 0.125)))) / Float64(Float64(x * x) + Float64(t_4 * Float64(t_4 - x))))) / exp(1)); else tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * x); t_1 = (x * x) * 0.5; t_2 = (x * x) * (-1.0 - t_1); t_3 = 1.0 + t_1; t_4 = x * t_1; tmp = 0.0; if ((x * x) <= 2e+45) tmp = ((1.0 + ((x * t_3) * ((t_3 * t_0) * (t_3 * ((x * x) * t_2))))) / ((1.0 + (t_3 * ((x * x) * ((x * x) * t_3)))) * (1.0 + t_2))) / 2.71828182845904523536; elseif ((x * x) <= 5e+102) tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_4 * (t_4 - x))))) / 2.71828182845904523536; else tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(x * t$95$1), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e+45], N[(N[(N[(1.0 + N[(N[(x * t$95$3), $MachinePrecision] * N[(N[(t$95$3 * t$95$0), $MachinePrecision] * N[(t$95$3 * N[(N[(x * x), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(t$95$3 * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e+102], N[(N[(1.0 + N[(N[(x * N[(t$95$0 + N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(t$95$4 * N[(t$95$4 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \left(x \cdot x\right) \cdot 0.5\\
t_2 := \left(x \cdot x\right) \cdot \left(-1 - t\_1\right)\\
t_3 := 1 + t\_1\\
t_4 := x \cdot t\_1\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{+45}:\\
\;\;\;\;\frac{\frac{1 + \left(x \cdot t\_3\right) \cdot \left(\left(t\_3 \cdot t\_0\right) \cdot \left(t\_3 \cdot \left(\left(x \cdot x\right) \cdot t\_2\right)\right)\right)}{\left(1 + t\_3 \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot t\_3\right)\right)\right) \cdot \left(1 + t\_2\right)}}{e}\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+102}:\\
\;\;\;\;\frac{1 + \frac{x \cdot \left(t\_0 + t\_0 \cdot \left(\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) \cdot 0.125\right)\right)}{x \cdot x + t\_4 \cdot \left(t\_4 - x\right)}}{e}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.9999999999999999e45Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6493.6%
Simplified93.6%
Applied egg-rr94.9%
if 1.9999999999999999e45 < (*.f64 x x) < 5e102Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.7%
Simplified4.7%
distribute-lft-inN/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr73.9%
if 5e102 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification95.9%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x)))
(t_1 (* x t_0))
(t_2 (* t_0 t_1))
(t_3 (* x t_2))
(t_4 (* (* x x) 0.5))
(t_5 (- 1.0 (* x x))))
(if (<= (* x x) 2e+37)
(/ (+ 1.0 (* x (* x (+ 1.0 t_4)))) E)
(if (<= (* x x) 2e+62)
(/
(/ (- 1.0 (* (* x x) (* t_2 t_2))) (+ 1.0 t_3))
(* (+ 1.0 (* (* x x) (* x x))) t_5))
(if (<= (* x x) 5e+153)
(/ (/ (- 1.0 t_3) t_5) (+ 1.0 t_1))
(* x (* x t_4)))))))
double code(double x) {
double t_0 = x * (x * x);
double t_1 = x * t_0;
double t_2 = t_0 * t_1;
double t_3 = x * t_2;
double t_4 = (x * x) * 0.5;
double t_5 = 1.0 - (x * x);
double tmp;
if ((x * x) <= 2e+37) {
tmp = (1.0 + (x * (x * (1.0 + t_4)))) / ((double) M_E);
} else if ((x * x) <= 2e+62) {
tmp = ((1.0 - ((x * x) * (t_2 * t_2))) / (1.0 + t_3)) / ((1.0 + ((x * x) * (x * x))) * t_5);
} else if ((x * x) <= 5e+153) {
tmp = ((1.0 - t_3) / t_5) / (1.0 + t_1);
} else {
tmp = x * (x * t_4);
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * x);
double t_1 = x * t_0;
double t_2 = t_0 * t_1;
double t_3 = x * t_2;
double t_4 = (x * x) * 0.5;
double t_5 = 1.0 - (x * x);
double tmp;
if ((x * x) <= 2e+37) {
tmp = (1.0 + (x * (x * (1.0 + t_4)))) / Math.E;
} else if ((x * x) <= 2e+62) {
tmp = ((1.0 - ((x * x) * (t_2 * t_2))) / (1.0 + t_3)) / ((1.0 + ((x * x) * (x * x))) * t_5);
} else if ((x * x) <= 5e+153) {
tmp = ((1.0 - t_3) / t_5) / (1.0 + t_1);
} else {
tmp = x * (x * t_4);
}
return tmp;
}
def code(x): t_0 = x * (x * x) t_1 = x * t_0 t_2 = t_0 * t_1 t_3 = x * t_2 t_4 = (x * x) * 0.5 t_5 = 1.0 - (x * x) tmp = 0 if (x * x) <= 2e+37: tmp = (1.0 + (x * (x * (1.0 + t_4)))) / math.e elif (x * x) <= 2e+62: tmp = ((1.0 - ((x * x) * (t_2 * t_2))) / (1.0 + t_3)) / ((1.0 + ((x * x) * (x * x))) * t_5) elif (x * x) <= 5e+153: tmp = ((1.0 - t_3) / t_5) / (1.0 + t_1) else: tmp = x * (x * t_4) return tmp
function code(x) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(x * t_0) t_2 = Float64(t_0 * t_1) t_3 = Float64(x * t_2) t_4 = Float64(Float64(x * x) * 0.5) t_5 = Float64(1.0 - Float64(x * x)) tmp = 0.0 if (Float64(x * x) <= 2e+37) tmp = Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + t_4)))) / exp(1)); elseif (Float64(x * x) <= 2e+62) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(t_2 * t_2))) / Float64(1.0 + t_3)) / Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(x * x))) * t_5)); elseif (Float64(x * x) <= 5e+153) tmp = Float64(Float64(Float64(1.0 - t_3) / t_5) / Float64(1.0 + t_1)); else tmp = Float64(x * Float64(x * t_4)); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * x); t_1 = x * t_0; t_2 = t_0 * t_1; t_3 = x * t_2; t_4 = (x * x) * 0.5; t_5 = 1.0 - (x * x); tmp = 0.0; if ((x * x) <= 2e+37) tmp = (1.0 + (x * (x * (1.0 + t_4)))) / 2.71828182845904523536; elseif ((x * x) <= 2e+62) tmp = ((1.0 - ((x * x) * (t_2 * t_2))) / (1.0 + t_3)) / ((1.0 + ((x * x) * (x * x))) * t_5); elseif ((x * x) <= 5e+153) tmp = ((1.0 - t_3) / t_5) / (1.0 + t_1); else tmp = x * (x * t_4); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$5 = N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e+37], N[(N[(1.0 + N[(x * N[(x * N[(1.0 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e+62], N[(N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e+153], N[(N[(N[(1.0 - t$95$3), $MachinePrecision] / t$95$5), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := x \cdot t\_0\\
t_2 := t\_0 \cdot t\_1\\
t_3 := x \cdot t\_2\\
t_4 := \left(x \cdot x\right) \cdot 0.5\\
t_5 := 1 - x \cdot x\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\frac{1 + x \cdot \left(x \cdot \left(1 + t\_4\right)\right)}{e}\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{1 - \left(x \cdot x\right) \cdot \left(t\_2 \cdot t\_2\right)}{1 + t\_3}}{\left(1 + \left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot t\_5}\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{1 - t\_3}{t\_5}}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot t\_4\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.99999999999999991e37Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.8%
Simplified94.8%
if 1.99999999999999991e37 < (*.f64 x x) < 2.00000000000000007e62Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f643.6%
Simplified3.6%
flip-+N/A
div-invN/A
metadata-evalN/A
flip--N/A
frac-timesN/A
/-lowering-/.f64N/A
Applied egg-rr3.6%
*-rgt-identityN/A
flip--N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if 2.00000000000000007e62 < (*.f64 x x) < 5.00000000000000018e153Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f644.1%
Simplified4.1%
flip-+N/A
div-invN/A
metadata-evalN/A
flip--N/A
frac-timesN/A
/-lowering-/.f64N/A
Applied egg-rr38.9%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if 5.00000000000000018e153 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification97.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (* (* x x) 0.5)) (t_2 (* x t_1)))
(if (<= (* x x) 5e+24)
(/ (+ 1.0 (* x (* x (+ 1.0 t_1)))) E)
(if (<= (* x x) 5e+102)
(/
(+
1.0
(/
(* x (+ t_0 (* t_0 (* (* (* x x) (* (* x x) (* x x))) 0.125))))
(+ (* x x) (* t_2 (- t_2 x)))))
E)
(+
1.0
(*
(* x x)
(+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666))))))))))
double code(double x) {
double t_0 = x * (x * x);
double t_1 = (x * x) * 0.5;
double t_2 = x * t_1;
double tmp;
if ((x * x) <= 5e+24) {
tmp = (1.0 + (x * (x * (1.0 + t_1)))) / ((double) M_E);
} else if ((x * x) <= 5e+102) {
tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_2 * (t_2 - x))))) / ((double) M_E);
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * x);
double t_1 = (x * x) * 0.5;
double t_2 = x * t_1;
double tmp;
if ((x * x) <= 5e+24) {
tmp = (1.0 + (x * (x * (1.0 + t_1)))) / Math.E;
} else if ((x * x) <= 5e+102) {
tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_2 * (t_2 - x))))) / Math.E;
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
def code(x): t_0 = x * (x * x) t_1 = (x * x) * 0.5 t_2 = x * t_1 tmp = 0 if (x * x) <= 5e+24: tmp = (1.0 + (x * (x * (1.0 + t_1)))) / math.e elif (x * x) <= 5e+102: tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_2 * (t_2 - x))))) / math.e else: tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))) return tmp
function code(x) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(Float64(x * x) * 0.5) t_2 = Float64(x * t_1) tmp = 0.0 if (Float64(x * x) <= 5e+24) tmp = Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + t_1)))) / exp(1)); elseif (Float64(x * x) <= 5e+102) tmp = Float64(Float64(1.0 + Float64(Float64(x * Float64(t_0 + Float64(t_0 * Float64(Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(x * x))) * 0.125)))) / Float64(Float64(x * x) + Float64(t_2 * Float64(t_2 - x))))) / exp(1)); else tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * x); t_1 = (x * x) * 0.5; t_2 = x * t_1; tmp = 0.0; if ((x * x) <= 5e+24) tmp = (1.0 + (x * (x * (1.0 + t_1)))) / 2.71828182845904523536; elseif ((x * x) <= 5e+102) tmp = (1.0 + ((x * (t_0 + (t_0 * (((x * x) * ((x * x) * (x * x))) * 0.125)))) / ((x * x) + (t_2 * (t_2 - x))))) / 2.71828182845904523536; else tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$2 = N[(x * t$95$1), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5e+24], N[(N[(1.0 + N[(x * N[(x * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e+102], N[(N[(1.0 + N[(N[(x * N[(t$95$0 + N[(t$95$0 * N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(t$95$2 * N[(t$95$2 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := \left(x \cdot x\right) \cdot 0.5\\
t_2 := x \cdot t\_1\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\frac{1 + x \cdot \left(x \cdot \left(1 + t\_1\right)\right)}{e}\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+102}:\\
\;\;\;\;\frac{1 + \frac{x \cdot \left(t\_0 + t\_0 \cdot \left(\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) \cdot 0.125\right)\right)}{x \cdot x + t\_2 \cdot \left(t\_2 - x\right)}}{e}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 5.00000000000000045e24Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6496.7%
Simplified96.7%
if 5.00000000000000045e24 < (*.f64 x x) < 5e102Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f644.4%
Simplified4.4%
distribute-lft-inN/A
flip3-+N/A
associate-*r/N/A
/-lowering-/.f64N/A
Applied egg-rr52.0%
if 5e102 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification95.1%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (* x t_0)) (t_2 (* (* x x) 0.5)))
(if (<= (* x x) 2e+62)
(/ (+ 1.0 (* x (* x (+ 1.0 t_2)))) E)
(if (<= (* x x) 5e+153)
(/ (/ (- 1.0 (* x (* t_0 t_1))) (- 1.0 (* x x))) (+ 1.0 t_1))
(* x (* x t_2))))))
double code(double x) {
double t_0 = x * (x * x);
double t_1 = x * t_0;
double t_2 = (x * x) * 0.5;
double tmp;
if ((x * x) <= 2e+62) {
tmp = (1.0 + (x * (x * (1.0 + t_2)))) / ((double) M_E);
} else if ((x * x) <= 5e+153) {
tmp = ((1.0 - (x * (t_0 * t_1))) / (1.0 - (x * x))) / (1.0 + t_1);
} else {
tmp = x * (x * t_2);
}
return tmp;
}
public static double code(double x) {
double t_0 = x * (x * x);
double t_1 = x * t_0;
double t_2 = (x * x) * 0.5;
double tmp;
if ((x * x) <= 2e+62) {
tmp = (1.0 + (x * (x * (1.0 + t_2)))) / Math.E;
} else if ((x * x) <= 5e+153) {
tmp = ((1.0 - (x * (t_0 * t_1))) / (1.0 - (x * x))) / (1.0 + t_1);
} else {
tmp = x * (x * t_2);
}
return tmp;
}
def code(x): t_0 = x * (x * x) t_1 = x * t_0 t_2 = (x * x) * 0.5 tmp = 0 if (x * x) <= 2e+62: tmp = (1.0 + (x * (x * (1.0 + t_2)))) / math.e elif (x * x) <= 5e+153: tmp = ((1.0 - (x * (t_0 * t_1))) / (1.0 - (x * x))) / (1.0 + t_1) else: tmp = x * (x * t_2) return tmp
function code(x) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(x * t_0) t_2 = Float64(Float64(x * x) * 0.5) tmp = 0.0 if (Float64(x * x) <= 2e+62) tmp = Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + t_2)))) / exp(1)); elseif (Float64(x * x) <= 5e+153) tmp = Float64(Float64(Float64(1.0 - Float64(x * Float64(t_0 * t_1))) / Float64(1.0 - Float64(x * x))) / Float64(1.0 + t_1)); else tmp = Float64(x * Float64(x * t_2)); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * x); t_1 = x * t_0; t_2 = (x * x) * 0.5; tmp = 0.0; if ((x * x) <= 2e+62) tmp = (1.0 + (x * (x * (1.0 + t_2)))) / 2.71828182845904523536; elseif ((x * x) <= 5e+153) tmp = ((1.0 - (x * (t_0 * t_1))) / (1.0 - (x * x))) / (1.0 + t_1); else tmp = x * (x * t_2); end tmp_2 = tmp; end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 2e+62], N[(N[(1.0 + N[(x * N[(x * N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e+153], N[(N[(N[(1.0 - N[(x * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := x \cdot t\_0\\
t_2 := \left(x \cdot x\right) \cdot 0.5\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\frac{1 + x \cdot \left(x \cdot \left(1 + t\_2\right)\right)}{e}\\
\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{1 - x \cdot \left(t\_0 \cdot t\_1\right)}{1 - x \cdot x}}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot t\_2\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 2.00000000000000007e62Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.3%
Simplified91.3%
if 2.00000000000000007e62 < (*.f64 x x) < 5.00000000000000018e153Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f644.1%
Simplified4.1%
flip-+N/A
div-invN/A
metadata-evalN/A
flip--N/A
frac-timesN/A
/-lowering-/.f64N/A
Applied egg-rr38.9%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if 5.00000000000000018e153 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification94.8%
(FPCore (x)
:precision binary64
(if (<= (* x x) 5e-8)
(/ (+ 1.0 (* x (* x (+ 1.0 (* (* x x) 0.5))))) E)
(+
1.0
(* (* x x) (+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666))))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / ((double) M_E);
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / Math.E;
} else {
tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666)))));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-8: tmp = (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / math.e else: tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5))))) / exp(1)); else tmp = Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-8) tmp = (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / 2.71828182845904523536; else tmp = 1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(1.0 + N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)}{e}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-8) (/ (/ 1.0 E) (/ 1.0 (+ (* x x) 1.0))) (+ 1.0 (* x (* x (+ 1.0 (* (* x x) 0.5)))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 / ((double) M_E)) / (1.0 / ((x * x) + 1.0));
} else {
tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5))));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 / Math.E) / (1.0 / ((x * x) + 1.0));
} else {
tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5))));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-8: tmp = (1.0 / math.e) / (1.0 / ((x * x) + 1.0)) else: tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5)))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(1.0 / exp(1)) / Float64(1.0 / Float64(Float64(x * x) + 1.0))); else tmp = Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5))))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-8) tmp = (1.0 / 2.71828182845904523536) / (1.0 / ((x * x) + 1.0)); else tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5)))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(1.0 / E), $MachinePrecision] / N[(1.0 / N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{1}{e}}{\frac{1}{x \cdot x + 1}}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
clear-numN/A
associate-/r/N/A
flip-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
E-lowering-E.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Final simplification88.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-8) (/ (/ 1.0 E) (/ 1.0 (+ (* x x) 1.0))) (* x (* x (+ 1.0 (* (* x x) 0.5))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 / ((double) M_E)) / (1.0 / ((x * x) + 1.0));
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = (1.0 / Math.E) / (1.0 / ((x * x) + 1.0));
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-8: tmp = (1.0 / math.e) / (1.0 / ((x * x) + 1.0)) else: tmp = x * (x * (1.0 + ((x * x) * 0.5))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(1.0 / exp(1)) / Float64(1.0 / Float64(Float64(x * x) + 1.0))); else tmp = Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-8) tmp = (1.0 / 2.71828182845904523536) / (1.0 / ((x * x) + 1.0)); else tmp = x * (x * (1.0 + ((x * x) * 0.5))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(1.0 / E), $MachinePrecision] / N[(1.0 / N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{1}{e}}{\frac{1}{x \cdot x + 1}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
clear-numN/A
associate-/r/N/A
flip-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
E-lowering-E.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
lft-mult-inverseN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Final simplification88.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-8) (/ (+ (* x x) 1.0) E) (* x (* x (+ 1.0 (* (* x x) 0.5))))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((x * x) + 1.0) / Math.E;
} else {
tmp = x * (x * (1.0 + ((x * x) * 0.5)));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-8: tmp = ((x * x) + 1.0) / math.e else: tmp = x * (x * (1.0 + ((x * x) * 0.5))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); else tmp = Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5)))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-8) tmp = ((x * x) + 1.0) / 2.71828182845904523536; else tmp = x * (x * (1.0 + ((x * x) * 0.5))); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*l*N/A
unpow2N/A
cube-multN/A
associate-*r*N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
distribute-rgt-inN/A
lft-mult-inverseN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Final simplification88.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-8) (/ (+ (* x x) 1.0) E) (* x (* x (* (* x x) 0.5)))))
double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 5e-8) {
tmp = ((x * x) + 1.0) / Math.E;
} else {
tmp = x * (x * ((x * x) * 0.5));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 5e-8: tmp = ((x * x) + 1.0) / math.e else: tmp = x * (x * ((x * x) * 0.5)) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 5e-8) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); else tmp = Float64(x * Float64(x * Float64(Float64(x * x) * 0.5))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 5e-8) tmp = ((x * x) + 1.0) / 2.71828182845904523536; else tmp = x * (x * ((x * x) * 0.5)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-8], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], N[(x * N[(x * N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 4.9999999999999998e-8Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if 4.9999999999999998e-8 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6474.2%
Simplified74.2%
Final simplification88.2%
(FPCore (x) :precision binary64 (/ (+ 1.0 (* x (* x (+ 1.0 (* (* x x) 0.5))))) E))
double code(double x) {
return (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / ((double) M_E);
}
public static double code(double x) {
return (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / Math.E;
}
def code(x): return (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / math.e
function code(x) return Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * 0.5))))) / exp(1)) end
function tmp = code(x) tmp = (1.0 + (x * (x * (1.0 + ((x * x) * 0.5))))) / 2.71828182845904523536; end
code[x_] := N[(N[(1.0 + N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\right)}{e}
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.2%
Simplified88.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.78) (/ 1.0 E) (+ (* x x) 1.0)))
double code(double x) {
double tmp;
if ((x * x) <= 0.78) {
tmp = 1.0 / ((double) M_E);
} else {
tmp = (x * x) + 1.0;
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 0.78) {
tmp = 1.0 / Math.E;
} else {
tmp = (x * x) + 1.0;
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.78: tmp = 1.0 / math.e else: tmp = (x * x) + 1.0 return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.78) tmp = Float64(1.0 / exp(1)); else tmp = Float64(Float64(x * x) + 1.0); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.78) tmp = 1.0 / 2.71828182845904523536; else tmp = (x * x) + 1.0; end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.78], N[(1.0 / E), $MachinePrecision], N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.78:\\
\;\;\;\;\frac{1}{e}\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + 1\\
\end{array}
\end{array}
if (*.f64 x x) < 0.78000000000000003Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
exp-lowering-exp.f6498.9%
Simplified98.9%
metadata-evalN/A
rec-expN/A
e-exp-1N/A
/-lowering-/.f64N/A
E-lowering-E.f6498.9%
Applied egg-rr98.9%
if 0.78000000000000003 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
Final simplification76.9%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.37) (/ 1.0 E) (* x x)))
double code(double x) {
double tmp;
if ((x * x) <= 0.37) {
tmp = 1.0 / ((double) M_E);
} else {
tmp = x * x;
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 0.37) {
tmp = 1.0 / Math.E;
} else {
tmp = x * x;
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.37: tmp = 1.0 / math.e else: tmp = x * x return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.37) tmp = Float64(1.0 / exp(1)); else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.37) tmp = 1.0 / 2.71828182845904523536; else tmp = x * x; end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.37], N[(1.0 / E), $MachinePrecision], N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.37:\\
\;\;\;\;\frac{1}{e}\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 0.37Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
exp-lowering-exp.f6498.9%
Simplified98.9%
metadata-evalN/A
rec-expN/A
e-exp-1N/A
/-lowering-/.f64N/A
E-lowering-E.f6498.9%
Applied egg-rr98.9%
if 0.37 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.2) 1.0 (* x x)))
double code(double x) {
double tmp;
if ((x * x) <= 0.2) {
tmp = 1.0;
} else {
tmp = x * x;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if ((x * x) <= 0.2d0) then
tmp = 1.0d0
else
tmp = x * x
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if ((x * x) <= 0.2) {
tmp = 1.0;
} else {
tmp = x * x;
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.2: tmp = 1.0 else: tmp = x * x return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.2) tmp = 1.0; else tmp = Float64(x * x); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 0.2) tmp = 1.0; else tmp = x * x; end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 0.2], 1.0, N[(x * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 0.2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x \cdot x\\
\end{array}
\end{array}
if (*.f64 x x) < 0.20000000000000001Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6417.8%
Simplified17.8%
Taylor expanded in x around 0
Simplified17.8%
if 0.20000000000000001 < (*.f64 x x) Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6450.8%
Simplified50.8%
(FPCore (x) :precision binary64 (/ (+ (* x x) 1.0) E))
double code(double x) {
return ((x * x) + 1.0) / ((double) M_E);
}
public static double code(double x) {
return ((x * x) + 1.0) / Math.E;
}
def code(x): return ((x * x) + 1.0) / math.e
function code(x) return Float64(Float64(Float64(x * x) + 1.0) / exp(1)) end
function tmp = code(x) tmp = ((x * x) + 1.0) / 2.71828182845904523536; end
code[x_] := N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot x + 1}{e}
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
metadata-evalN/A
metadata-evalN/A
sub-negN/A
exp-diffN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6477.5%
Simplified77.5%
Final simplification77.5%
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6455.0%
Simplified55.0%
Taylor expanded in x around 0
Simplified11.1%
herbie shell --seed 2024138
(FPCore (x)
:name "exp neg sub"
:precision binary64
(exp (- (- 1.0 (* x x)))))