
(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 14 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 (pow E (+ (* x x) -1.0)))
double code(double x) {
return pow(((double) M_E), ((x * x) + -1.0));
}
public static double code(double x) {
return Math.pow(Math.E, ((x * x) + -1.0));
}
def code(x): return math.pow(math.e, ((x * x) + -1.0))
function code(x) return exp(1) ^ Float64(Float64(x * x) + -1.0) end
function tmp = code(x) tmp = 2.71828182845904523536 ^ ((x * x) + -1.0); end
code[x_] := N[Power[E, N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
{e}^{\left(x \cdot x + -1\right)}
\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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
(FPCore (x) :precision binary64 (if (<= (* x x) 1e-10) (/ (+ (* x x) 1.0) E) (exp (* x x))))
double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} else {
tmp = exp((x * x));
}
return tmp;
}
public static double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / Math.E;
} else {
tmp = Math.exp((x * x));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 1e-10: tmp = ((x * x) + 1.0) / math.e else: tmp = math.exp((x * x)) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 1e-10) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); else tmp = exp(Float64(x * x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if ((x * x) <= 1e-10) tmp = ((x * x) + 1.0) / 2.71828182845904523536; else tmp = exp((x * x)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 1e-10], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{-10}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{else}:\\
\;\;\;\;e^{x \cdot x}\\
\end{array}
\end{array}
if (*.f64 x x) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.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.4%
Simplified99.4%
Final simplification99.7%
(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 x)))
(t_1 (* x (* (* x x) t_0)))
(t_2 (* x (* x t_1)))
(t_3 (* x t_0))
(t_4 (* (- 1.0 (* x x)) (+ 1.0 t_3))))
(if (<= (* x x) 1e-10)
(/ (+ (* x x) 1.0) E)
(if (<= (* x x) 2e+72)
(/ (/ (- 1.0 (* (* x x) (* t_1 t_2))) (+ 1.0 t_2)) t_4)
(if (<= (* x x) 2e+102)
(/ (- 1.0 (* (* x x) (* x (* x t_3)))) t_4)
(+
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 * x) * t_0);
double t_2 = x * (x * t_1);
double t_3 = x * t_0;
double t_4 = (1.0 - (x * x)) * (1.0 + t_3);
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} else if ((x * x) <= 2e+72) {
tmp = ((1.0 - ((x * x) * (t_1 * t_2))) / (1.0 + t_2)) / t_4;
} else if ((x * x) <= 2e+102) {
tmp = (1.0 - ((x * x) * (x * (x * t_3)))) / t_4;
} 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 * x) * t_0);
double t_2 = x * (x * t_1);
double t_3 = x * t_0;
double t_4 = (1.0 - (x * x)) * (1.0 + t_3);
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / Math.E;
} else if ((x * x) <= 2e+72) {
tmp = ((1.0 - ((x * x) * (t_1 * t_2))) / (1.0 + t_2)) / t_4;
} else if ((x * x) <= 2e+102) {
tmp = (1.0 - ((x * x) * (x * (x * t_3)))) / t_4;
} 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 * x) * t_0) t_2 = x * (x * t_1) t_3 = x * t_0 t_4 = (1.0 - (x * x)) * (1.0 + t_3) tmp = 0 if (x * x) <= 1e-10: tmp = ((x * x) + 1.0) / math.e elif (x * x) <= 2e+72: tmp = ((1.0 - ((x * x) * (t_1 * t_2))) / (1.0 + t_2)) / t_4 elif (x * x) <= 2e+102: tmp = (1.0 - ((x * x) * (x * (x * t_3)))) / t_4 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(x * Float64(Float64(x * x) * t_0)) t_2 = Float64(x * Float64(x * t_1)) t_3 = Float64(x * t_0) t_4 = Float64(Float64(1.0 - Float64(x * x)) * Float64(1.0 + t_3)) tmp = 0.0 if (Float64(x * x) <= 1e-10) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); elseif (Float64(x * x) <= 2e+72) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(t_1 * t_2))) / Float64(1.0 + t_2)) / t_4); elseif (Float64(x * x) <= 2e+102) tmp = Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(x * Float64(x * t_3)))) / t_4); else tmp = Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(x * Float64(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 * x) * t_0); t_2 = x * (x * t_1); t_3 = x * t_0; t_4 = (1.0 - (x * x)) * (1.0 + t_3); tmp = 0.0; if ((x * x) <= 1e-10) tmp = ((x * x) + 1.0) / 2.71828182845904523536; elseif ((x * x) <= 2e+72) tmp = ((1.0 - ((x * x) * (t_1 * t_2))) / (1.0 + t_2)) / t_4; elseif ((x * x) <= 2e+102) tmp = (1.0 - ((x * x) * (x * (x * t_3)))) / t_4; 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[(x * N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e-10], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e+72], N[(N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e+102], N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := x \cdot \left(\left(x \cdot x\right) \cdot t\_0\right)\\
t_2 := x \cdot \left(x \cdot t\_1\right)\\
t_3 := x \cdot t\_0\\
t_4 := \left(1 - x \cdot x\right) \cdot \left(1 + t\_3\right)\\
\mathbf{if}\;x \cdot x \leq 10^{-10}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{1 - \left(x \cdot x\right) \cdot \left(t\_1 \cdot t\_2\right)}{1 + t\_2}}{t\_4}\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\frac{1 - \left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot t\_3\right)\right)}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.f64 x x) < 1.99999999999999989e72Initial program 99.9%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6495.2%
Simplified95.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f644.3%
Simplified4.3%
flip-+N/A
metadata-evalN/A
flip--N/A
associate-/l/N/A
/-lowering-/.f64N/A
Applied egg-rr4.3%
flip--N/A
/-lowering-/.f64N/A
Applied egg-rr55.3%
if 1.99999999999999989e72 < (*.f64 x x) < 1.99999999999999995e102Initial 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.9%
Simplified3.9%
flip-+N/A
metadata-evalN/A
flip--N/A
associate-/l/N/A
/-lowering-/.f64N/A
Applied egg-rr100.0%
if 1.99999999999999995e102 < (*.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
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*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%
Final simplification97.0%
(FPCore (x)
:precision binary64
(let* ((t_0 (* x (* x (* x x)))))
(if (<= (* x x) 1e-10)
(/ (+ (* x x) 1.0) E)
(if (<= (* x x) 2e+102)
(/ (- 1.0 (* (* x x) (* x (* x t_0)))) (* (- 1.0 (* x x)) (+ 1.0 t_0)))
(+
1.0
(*
x
(*
x
(+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666))))))))))))
double code(double x) {
double t_0 = x * (x * (x * x));
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} else if ((x * x) <= 2e+102) {
tmp = (1.0 - ((x * x) * (x * (x * t_0)))) / ((1.0 - (x * x)) * (1.0 + t_0));
} 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 * x));
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / Math.E;
} else if ((x * x) <= 2e+102) {
tmp = (1.0 - ((x * x) * (x * (x * t_0)))) / ((1.0 - (x * x)) * (1.0 + t_0));
} 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 * x)) tmp = 0 if (x * x) <= 1e-10: tmp = ((x * x) + 1.0) / math.e elif (x * x) <= 2e+102: tmp = (1.0 - ((x * x) * (x * (x * t_0)))) / ((1.0 - (x * x)) * (1.0 + t_0)) 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 * Float64(x * x))) tmp = 0.0 if (Float64(x * x) <= 1e-10) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); elseif (Float64(x * x) <= 2e+102) tmp = Float64(Float64(1.0 - Float64(Float64(x * x) * Float64(x * Float64(x * t_0)))) / Float64(Float64(1.0 - Float64(x * x)) * Float64(1.0 + t_0))); else tmp = Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))))); end return tmp end
function tmp_2 = code(x) t_0 = x * (x * (x * x)); tmp = 0.0; if ((x * x) <= 1e-10) tmp = ((x * x) + 1.0) / 2.71828182845904523536; elseif ((x * x) <= 2e+102) tmp = (1.0 - ((x * x) * (x * (x * t_0)))) / ((1.0 - (x * x)) * (1.0 + t_0)); 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 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e-10], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 2e+102], N[(N[(1.0 - N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;x \cdot x \leq 10^{-10}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\frac{1 - \left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot t\_0\right)\right)}{\left(1 - x \cdot x\right) \cdot \left(1 + t\_0\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.f64 x x) < 1.99999999999999995e102Initial program 99.9%
exp-lowering-exp.f64N/A
neg-sub0N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f644.2%
Simplified4.2%
flip-+N/A
metadata-evalN/A
flip--N/A
associate-/l/N/A
/-lowering-/.f64N/A
Applied egg-rr32.2%
if 1.99999999999999995e102 < (*.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
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*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%
Final simplification93.6%
(FPCore (x)
:precision binary64
(if (<= (* x x) 1e-10)
(/ (+ (* x x) 1.0) E)
(+
1.0
(* x (* x (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666))))))))))
double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / ((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) <= 1e-10) {
tmp = ((x * x) + 1.0) / 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) <= 1e-10: tmp = ((x * x) + 1.0) / 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) <= 1e-10) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); else tmp = Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(x * Float64(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) <= 1e-10) tmp = ((x * x) + 1.0) / 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], 1e-10], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 10^{-10}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x x) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.8%
Simplified83.8%
Final simplification91.2%
(FPCore (x) :precision binary64 (if (<= (* x x) 1e-10) (/ (+ (* x x) 1.0) E) (+ 1.0 (* x (* x (+ 1.0 (* (* x x) 0.5)))))))
double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
tmp = ((x * x) + 1.0) / ((double) M_E);
} 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) <= 1e-10) {
tmp = ((x * x) + 1.0) / Math.E;
} else {
tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5))));
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 1e-10: tmp = ((x * x) + 1.0) / math.e else: tmp = 1.0 + (x * (x * (1.0 + ((x * x) * 0.5)))) return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 1e-10) tmp = Float64(Float64(Float64(x * x) + 1.0) / exp(1)); 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) <= 1e-10) tmp = ((x * x) + 1.0) / 2.71828182845904523536; 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], 1e-10], N[(N[(N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / E), $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 10^{-10}:\\
\;\;\;\;\frac{x \cdot x + 1}{e}\\
\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) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.6%
Simplified77.6%
Final simplification87.8%
(FPCore (x) :precision binary64 (if (<= (* x x) 1e-10) (/ (+ (* x x) 1.0) E) (* x (* x (+ 1.0 (* (* x x) 0.5))))))
double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
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) <= 1e-10) {
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) <= 1e-10: 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) <= 1e-10) 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) <= 1e-10) 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], 1e-10], 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 10^{-10}:\\
\;\;\;\;\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) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.6%
Simplified77.6%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
associate-*r*N/A
+-commutativeN/A
distribute-rgt-inN/A
lft-mult-inverseN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.6%
Simplified77.6%
Final simplification87.8%
(FPCore (x) :precision binary64 (if (<= (* x x) 1e-10) (/ (+ (* x x) 1.0) E) (* x (* x (* (* x x) 0.5)))))
double code(double x) {
double tmp;
if ((x * x) <= 1e-10) {
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) <= 1e-10) {
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) <= 1e-10: 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) <= 1e-10) 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) <= 1e-10) 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], 1e-10], 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 10^{-10}:\\
\;\;\;\;\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) < 1.00000000000000004e-10Initial 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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified100.0%
if 1.00000000000000004e-10 < (*.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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6477.6%
Simplified77.6%
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-*.f6477.6%
Simplified77.6%
Final simplification87.8%
(FPCore (x) :precision binary64 (if (<= (* x x) 0.79) (/ 1.0 E) (+ (* x x) 1.0)))
double code(double x) {
double tmp;
if ((x * x) <= 0.79) {
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.79) {
tmp = 1.0 / Math.E;
} else {
tmp = (x * x) + 1.0;
}
return tmp;
}
def code(x): tmp = 0 if (x * x) <= 0.79: tmp = 1.0 / math.e else: tmp = (x * x) + 1.0 return tmp
function code(x) tmp = 0.0 if (Float64(x * x) <= 0.79) 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.79) 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.79], 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.79:\\
\;\;\;\;\frac{1}{e}\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + 1\\
\end{array}
\end{array}
if (*.f64 x x) < 0.79000000000000004Initial 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.f6499.5%
Simplified99.5%
metadata-evalN/A
rec-expN/A
e-exp-1N/A
/-lowering-/.f64N/A
E-lowering-E.f6499.5%
Applied egg-rr99.5%
if 0.79000000000000004 < (*.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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Final simplification74.3%
(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.f6499.5%
Simplified99.5%
metadata-evalN/A
rec-expN/A
e-exp-1N/A
/-lowering-/.f64N/A
E-lowering-E.f6499.5%
Applied egg-rr99.5%
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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
(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.4%
Simplified99.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6453.1%
Simplified53.1%
(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%
flip-+N/A
clear-numN/A
metadata-evalN/A
div-invN/A
clear-numN/A
flip-+N/A
difference-of-sqr--1N/A
difference-of-sqr-1N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
exp-prodN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
exp-1-eN/A
E-lowering-E.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
difference-of-sqr-1N/A
difference-of-sqr--1N/A
Applied egg-rr100.0%
Taylor expanded in x around 0
log-EN/A
metadata-evalN/A
log-EN/A
log-EN/A
metadata-evalN/A
metadata-evalN/A
log-EN/A
associate-/l*N/A
log-EN/A
metadata-evalN/A
distribute-rgt1-inN/A
*-commutativeN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
Simplified74.5%
Final simplification74.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-*.f6462.1%
Simplified62.1%
Taylor expanded in x around 0
Simplified9.9%
herbie shell --seed 2024139
(FPCore (x)
:name "exp neg sub"
:precision binary64
(exp (- (- 1.0 (* x x)))))