
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) 2.0))
double code(double x) {
return (exp(x) - exp(-x)) / 2.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (exp(x) - exp(-x)) / 2.0d0
end function
public static double code(double x) {
return (Math.exp(x) - Math.exp(-x)) / 2.0;
}
def code(x): return (math.exp(x) - math.exp(-x)) / 2.0
function code(x) return Float64(Float64(exp(x) - exp(Float64(-x))) / 2.0) end
function tmp = code(x) tmp = (exp(x) - exp(-x)) / 2.0; end
code[x_] := N[(N[(N[Exp[x], $MachinePrecision] - N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{x} - e^{-x}}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) 2.0))
double code(double x) {
return (exp(x) - exp(-x)) / 2.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (exp(x) - exp(-x)) / 2.0d0
end function
public static double code(double x) {
return (Math.exp(x) - Math.exp(-x)) / 2.0;
}
def code(x): return (math.exp(x) - math.exp(-x)) / 2.0
function code(x) return Float64(Float64(exp(x) - exp(Float64(-x))) / 2.0) end
function tmp = code(x) tmp = (exp(x) - exp(-x)) / 2.0; end
code[x_] := N[(N[(N[Exp[x], $MachinePrecision] - N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{x} - e^{-x}}{2}
\end{array}
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(let* ((t_0 (- (exp x_m) (exp (- x_m)))))
(*
x_s
(if (<= t_0 0.05)
(/
(+
(*
(fma
(pow x_m 2.0)
(fma (pow x_m 2.0) 0.0003968253968253968 0.016666666666666666)
0.3333333333333333)
(pow x_m 3.0))
(* x_m 2.0))
2.0)
(/ t_0 2.0)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double t_0 = exp(x_m) - exp(-x_m);
double tmp;
if (t_0 <= 0.05) {
tmp = ((fma(pow(x_m, 2.0), fma(pow(x_m, 2.0), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333) * pow(x_m, 3.0)) + (x_m * 2.0)) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) t_0 = Float64(exp(x_m) - exp(Float64(-x_m))) tmp = 0.0 if (t_0 <= 0.05) tmp = Float64(Float64(Float64(fma((x_m ^ 2.0), fma((x_m ^ 2.0), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333) * (x_m ^ 3.0)) + Float64(x_m * 2.0)) / 2.0); else tmp = Float64(t_0 / 2.0); end return Float64(x_s * tmp) end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := Block[{t$95$0 = N[(N[Exp[x$95$m], $MachinePrecision] - N[Exp[(-x$95$m)], $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$0, 0.05], N[(N[(N[(N[(N[Power[x$95$m, 2.0], $MachinePrecision] * N[(N[Power[x$95$m, 2.0], $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[Power[x$95$m, 3.0], $MachinePrecision]), $MachinePrecision] + N[(x$95$m * 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_0 := e^{x\_m} - e^{-x\_m}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0.05:\\
\;\;\;\;\frac{\mathsf{fma}\left({x\_m}^{2}, \mathsf{fma}\left({x\_m}^{2}, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right) \cdot {x\_m}^{3} + x\_m \cdot 2}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) < 0.050000000000000003Initial program 34.5%
Taylor expanded in x around 0 97.5%
*-commutative97.5%
Simplified97.5%
+-commutative97.5%
distribute-lft-in97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define97.5%
unpow297.5%
pow397.5%
Applied egg-rr97.5%
if 0.050000000000000003 < (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) Initial program 100.0%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(let* ((t_0 (- (exp x_m) (exp (- x_m)))))
(*
x_s
(if (<= t_0 0.05)
(/
(*
x_m
(+
2.0
(*
(pow x_m 2.0)
(+
0.3333333333333333
(*
(* x_m x_m)
(+ 0.016666666666666666 (* 0.0003968253968253968 (* x_m x_m))))))))
2.0)
(/ t_0 2.0)))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double t_0 = exp(x_m) - exp(-x_m);
double tmp;
if (t_0 <= 0.05) {
tmp = (x_m * (2.0 + (pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp(x_m) - exp(-x_m)
if (t_0 <= 0.05d0) then
tmp = (x_m * (2.0d0 + ((x_m ** 2.0d0) * (0.3333333333333333d0 + ((x_m * x_m) * (0.016666666666666666d0 + (0.0003968253968253968d0 * (x_m * x_m)))))))) / 2.0d0
else
tmp = t_0 / 2.0d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double t_0 = Math.exp(x_m) - Math.exp(-x_m);
double tmp;
if (t_0 <= 0.05) {
tmp = (x_m * (2.0 + (Math.pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): t_0 = math.exp(x_m) - math.exp(-x_m) tmp = 0 if t_0 <= 0.05: tmp = (x_m * (2.0 + (math.pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0 else: tmp = t_0 / 2.0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) t_0 = Float64(exp(x_m) - exp(Float64(-x_m))) tmp = 0.0 if (t_0 <= 0.05) tmp = Float64(Float64(x_m * Float64(2.0 + Float64((x_m ^ 2.0) * Float64(0.3333333333333333 + Float64(Float64(x_m * x_m) * Float64(0.016666666666666666 + Float64(0.0003968253968253968 * Float64(x_m * x_m)))))))) / 2.0); else tmp = Float64(t_0 / 2.0); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) t_0 = exp(x_m) - exp(-x_m); tmp = 0.0; if (t_0 <= 0.05) tmp = (x_m * (2.0 + ((x_m ^ 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0; else tmp = t_0 / 2.0; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := Block[{t$95$0 = N[(N[Exp[x$95$m], $MachinePrecision] - N[Exp[(-x$95$m)], $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$0, 0.05], N[(N[(x$95$m * N[(2.0 + N[(N[Power[x$95$m, 2.0], $MachinePrecision] * N[(0.3333333333333333 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.016666666666666666 + N[(0.0003968253968253968 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
\begin{array}{l}
t_0 := e^{x\_m} - e^{-x\_m}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0.05:\\
\;\;\;\;\frac{x\_m \cdot \left(2 + {x\_m}^{2} \cdot \left(0.3333333333333333 + \left(x\_m \cdot x\_m\right) \cdot \left(0.016666666666666666 + 0.0003968253968253968 \cdot \left(x\_m \cdot x\_m\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
\end{array}
if (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) < 0.050000000000000003Initial program 34.5%
Taylor expanded in x around 0 97.5%
*-commutative97.5%
Simplified97.5%
unpow297.5%
Applied egg-rr97.5%
unpow297.5%
Applied egg-rr97.5%
if 0.050000000000000003 < (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) Initial program 100.0%
Final simplification98.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(if (<= x_m 3.8)
(/
(*
x_m
(+
2.0
(*
(pow x_m 2.0)
(+
0.3333333333333333
(*
(* x_m x_m)
(+ 0.016666666666666666 (* 0.0003968253968253968 (* x_m x_m))))))))
2.0)
(/ (+ (exp x_m) -1.0) 2.0))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double tmp;
if (x_m <= 3.8) {
tmp = (x_m * (2.0 + (pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0;
} else {
tmp = (exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: tmp
if (x_m <= 3.8d0) then
tmp = (x_m * (2.0d0 + ((x_m ** 2.0d0) * (0.3333333333333333d0 + ((x_m * x_m) * (0.016666666666666666d0 + (0.0003968253968253968d0 * (x_m * x_m)))))))) / 2.0d0
else
tmp = (exp(x_m) + (-1.0d0)) / 2.0d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double tmp;
if (x_m <= 3.8) {
tmp = (x_m * (2.0 + (Math.pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0;
} else {
tmp = (Math.exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): tmp = 0 if x_m <= 3.8: tmp = (x_m * (2.0 + (math.pow(x_m, 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0 else: tmp = (math.exp(x_m) + -1.0) / 2.0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) tmp = 0.0 if (x_m <= 3.8) tmp = Float64(Float64(x_m * Float64(2.0 + Float64((x_m ^ 2.0) * Float64(0.3333333333333333 + Float64(Float64(x_m * x_m) * Float64(0.016666666666666666 + Float64(0.0003968253968253968 * Float64(x_m * x_m)))))))) / 2.0); else tmp = Float64(Float64(exp(x_m) + -1.0) / 2.0); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) tmp = 0.0; if (x_m <= 3.8) tmp = (x_m * (2.0 + ((x_m ^ 2.0) * (0.3333333333333333 + ((x_m * x_m) * (0.016666666666666666 + (0.0003968253968253968 * (x_m * x_m)))))))) / 2.0; else tmp = (exp(x_m) + -1.0) / 2.0; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * If[LessEqual[x$95$m, 3.8], N[(N[(x$95$m * N[(2.0 + N[(N[Power[x$95$m, 2.0], $MachinePrecision] * N[(0.3333333333333333 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.016666666666666666 + N[(0.0003968253968253968 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[x$95$m], $MachinePrecision] + -1.0), $MachinePrecision] / 2.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.8:\\
\;\;\;\;\frac{x\_m \cdot \left(2 + {x\_m}^{2} \cdot \left(0.3333333333333333 + \left(x\_m \cdot x\_m\right) \cdot \left(0.016666666666666666 + 0.0003968253968253968 \cdot \left(x\_m \cdot x\_m\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x\_m} + -1}{2}\\
\end{array}
\end{array}
if x < 3.7999999999999998Initial program 34.5%
Taylor expanded in x around 0 97.5%
*-commutative97.5%
Simplified97.5%
unpow297.5%
Applied egg-rr97.5%
unpow297.5%
Applied egg-rr97.5%
if 3.7999999999999998 < x Initial program 100.0%
Taylor expanded in x around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.9%
Final simplification97.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(if (<= x_m 3.0)
(/
(*
x_m
(+
2.0
(*
(pow x_m 2.0)
(+ 0.3333333333333333 (* 0.016666666666666666 (* x_m x_m))))))
2.0)
(/ (+ (exp x_m) -1.0) 2.0))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double tmp;
if (x_m <= 3.0) {
tmp = (x_m * (2.0 + (pow(x_m, 2.0) * (0.3333333333333333 + (0.016666666666666666 * (x_m * x_m)))))) / 2.0;
} else {
tmp = (exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: tmp
if (x_m <= 3.0d0) then
tmp = (x_m * (2.0d0 + ((x_m ** 2.0d0) * (0.3333333333333333d0 + (0.016666666666666666d0 * (x_m * x_m)))))) / 2.0d0
else
tmp = (exp(x_m) + (-1.0d0)) / 2.0d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double tmp;
if (x_m <= 3.0) {
tmp = (x_m * (2.0 + (Math.pow(x_m, 2.0) * (0.3333333333333333 + (0.016666666666666666 * (x_m * x_m)))))) / 2.0;
} else {
tmp = (Math.exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): tmp = 0 if x_m <= 3.0: tmp = (x_m * (2.0 + (math.pow(x_m, 2.0) * (0.3333333333333333 + (0.016666666666666666 * (x_m * x_m)))))) / 2.0 else: tmp = (math.exp(x_m) + -1.0) / 2.0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) tmp = 0.0 if (x_m <= 3.0) tmp = Float64(Float64(x_m * Float64(2.0 + Float64((x_m ^ 2.0) * Float64(0.3333333333333333 + Float64(0.016666666666666666 * Float64(x_m * x_m)))))) / 2.0); else tmp = Float64(Float64(exp(x_m) + -1.0) / 2.0); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) tmp = 0.0; if (x_m <= 3.0) tmp = (x_m * (2.0 + ((x_m ^ 2.0) * (0.3333333333333333 + (0.016666666666666666 * (x_m * x_m)))))) / 2.0; else tmp = (exp(x_m) + -1.0) / 2.0; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * If[LessEqual[x$95$m, 3.0], N[(N[(x$95$m * N[(2.0 + N[(N[Power[x$95$m, 2.0], $MachinePrecision] * N[(0.3333333333333333 + N[(0.016666666666666666 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[x$95$m], $MachinePrecision] + -1.0), $MachinePrecision] / 2.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3:\\
\;\;\;\;\frac{x\_m \cdot \left(2 + {x\_m}^{2} \cdot \left(0.3333333333333333 + 0.016666666666666666 \cdot \left(x\_m \cdot x\_m\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x\_m} + -1}{2}\\
\end{array}
\end{array}
if x < 3Initial program 34.5%
Taylor expanded in x around 0 96.5%
*-commutative96.5%
Simplified96.5%
unpow297.5%
Applied egg-rr96.5%
if 3 < x Initial program 100.0%
Taylor expanded in x around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.9%
Final simplification97.1%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(if (<= x_m 2.15)
(+ x_m (* (pow x_m 3.0) 0.16666666666666666))
(/ (+ (exp x_m) -1.0) 2.0))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double tmp;
if (x_m <= 2.15) {
tmp = x_m + (pow(x_m, 3.0) * 0.16666666666666666);
} else {
tmp = (exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: tmp
if (x_m <= 2.15d0) then
tmp = x_m + ((x_m ** 3.0d0) * 0.16666666666666666d0)
else
tmp = (exp(x_m) + (-1.0d0)) / 2.0d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double tmp;
if (x_m <= 2.15) {
tmp = x_m + (Math.pow(x_m, 3.0) * 0.16666666666666666);
} else {
tmp = (Math.exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): tmp = 0 if x_m <= 2.15: tmp = x_m + (math.pow(x_m, 3.0) * 0.16666666666666666) else: tmp = (math.exp(x_m) + -1.0) / 2.0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) tmp = 0.0 if (x_m <= 2.15) tmp = Float64(x_m + Float64((x_m ^ 3.0) * 0.16666666666666666)); else tmp = Float64(Float64(exp(x_m) + -1.0) / 2.0); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) tmp = 0.0; if (x_m <= 2.15) tmp = x_m + ((x_m ^ 3.0) * 0.16666666666666666); else tmp = (exp(x_m) + -1.0) / 2.0; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * If[LessEqual[x$95$m, 2.15], N[(x$95$m + N[(N[Power[x$95$m, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[x$95$m], $MachinePrecision] + -1.0), $MachinePrecision] / 2.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.15:\\
\;\;\;\;x\_m + {x\_m}^{3} \cdot 0.16666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x\_m} + -1}{2}\\
\end{array}
\end{array}
if x < 2.14999999999999991Initial program 34.5%
Taylor expanded in x around 0 92.9%
Taylor expanded in x around 0 92.9%
distribute-rgt-in92.9%
*-lft-identity92.9%
associate-*r*92.9%
unpow292.9%
unpow392.9%
Simplified92.9%
if 2.14999999999999991 < x Initial program 100.0%
Taylor expanded in x around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.9%
Final simplification94.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(if (<= x_m 2.15)
(/ (* x_m (+ 2.0 (* 0.3333333333333333 (* x_m x_m)))) 2.0)
(/ (+ (exp x_m) -1.0) 2.0))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double tmp;
if (x_m <= 2.15) {
tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0;
} else {
tmp = (exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: tmp
if (x_m <= 2.15d0) then
tmp = (x_m * (2.0d0 + (0.3333333333333333d0 * (x_m * x_m)))) / 2.0d0
else
tmp = (exp(x_m) + (-1.0d0)) / 2.0d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double tmp;
if (x_m <= 2.15) {
tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0;
} else {
tmp = (Math.exp(x_m) + -1.0) / 2.0;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): tmp = 0 if x_m <= 2.15: tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0 else: tmp = (math.exp(x_m) + -1.0) / 2.0 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) tmp = 0.0 if (x_m <= 2.15) tmp = Float64(Float64(x_m * Float64(2.0 + Float64(0.3333333333333333 * Float64(x_m * x_m)))) / 2.0); else tmp = Float64(Float64(exp(x_m) + -1.0) / 2.0); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) tmp = 0.0; if (x_m <= 2.15) tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0; else tmp = (exp(x_m) + -1.0) / 2.0; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * If[LessEqual[x$95$m, 2.15], N[(N[(x$95$m * N[(2.0 + N[(0.3333333333333333 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[x$95$m], $MachinePrecision] + -1.0), $MachinePrecision] / 2.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.15:\\
\;\;\;\;\frac{x\_m \cdot \left(2 + 0.3333333333333333 \cdot \left(x\_m \cdot x\_m\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x\_m} + -1}{2}\\
\end{array}
\end{array}
if x < 2.14999999999999991Initial program 34.5%
Taylor expanded in x around 0 92.9%
unpow297.5%
Applied egg-rr92.9%
if 2.14999999999999991 < x Initial program 100.0%
Taylor expanded in x around 0 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 98.9%
Final simplification94.4%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(if (<= x_m 5.5)
(/ (* x_m (+ 2.0 (* 0.3333333333333333 (* x_m x_m)))) 2.0)
(* (pow x_m 7.0) 0.0001984126984126984))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
double tmp;
if (x_m <= 5.5) {
tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0;
} else {
tmp = pow(x_m, 7.0) * 0.0001984126984126984;
}
return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8) :: tmp
if (x_m <= 5.5d0) then
tmp = (x_m * (2.0d0 + (0.3333333333333333d0 * (x_m * x_m)))) / 2.0d0
else
tmp = (x_m ** 7.0d0) * 0.0001984126984126984d0
end if
code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
double tmp;
if (x_m <= 5.5) {
tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0;
} else {
tmp = Math.pow(x_m, 7.0) * 0.0001984126984126984;
}
return x_s * tmp;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): tmp = 0 if x_m <= 5.5: tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0 else: tmp = math.pow(x_m, 7.0) * 0.0001984126984126984 return x_s * tmp
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) tmp = 0.0 if (x_m <= 5.5) tmp = Float64(Float64(x_m * Float64(2.0 + Float64(0.3333333333333333 * Float64(x_m * x_m)))) / 2.0); else tmp = Float64((x_m ^ 7.0) * 0.0001984126984126984); end return Float64(x_s * tmp) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp_2 = code(x_s, x_m) tmp = 0.0; if (x_m <= 5.5) tmp = (x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0; else tmp = (x_m ^ 7.0) * 0.0001984126984126984; end tmp_2 = x_s * tmp; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * If[LessEqual[x$95$m, 5.5], N[(N[(x$95$m * N[(2.0 + N[(0.3333333333333333 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[Power[x$95$m, 7.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 5.5:\\
\;\;\;\;\frac{x\_m \cdot \left(2 + 0.3333333333333333 \cdot \left(x\_m \cdot x\_m\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;{x\_m}^{7} \cdot 0.0001984126984126984\\
\end{array}
\end{array}
if x < 5.5Initial program 34.8%
Taylor expanded in x around 0 92.5%
unpow297.1%
Applied egg-rr92.5%
if 5.5 < x Initial program 100.0%
Taylor expanded in x around 0 79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in x around inf 80.7%
*-commutative80.7%
associate-/l*80.7%
metadata-eval80.7%
Applied egg-rr80.7%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m)
:precision binary64
(*
x_s
(*
x_m
(+
1.0
(*
x_m
(+ 0.25 (* x_m (+ 0.08333333333333333 (* x_m 0.020833333333333332)))))))))x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * (x_m * (1.0 + (x_m * (0.25 + (x_m * (0.08333333333333333 + (x_m * 0.020833333333333332)))))));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * (x_m * (1.0d0 + (x_m * (0.25d0 + (x_m * (0.08333333333333333d0 + (x_m * 0.020833333333333332d0)))))))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * (x_m * (1.0 + (x_m * (0.25 + (x_m * (0.08333333333333333 + (x_m * 0.020833333333333332)))))));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * (x_m * (1.0 + (x_m * (0.25 + (x_m * (0.08333333333333333 + (x_m * 0.020833333333333332)))))))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * Float64(x_m * Float64(1.0 + Float64(x_m * Float64(0.25 + Float64(x_m * Float64(0.08333333333333333 + Float64(x_m * 0.020833333333333332)))))))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * (x_m * (1.0 + (x_m * (0.25 + (x_m * (0.08333333333333333 + (x_m * 0.020833333333333332))))))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * N[(x$95$m * N[(1.0 + N[(x$95$m * N[(0.25 + N[(x$95$m * N[(0.08333333333333333 + N[(x$95$m * 0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \left(1 + x\_m \cdot \left(0.25 + x\_m \cdot \left(0.08333333333333333 + x\_m \cdot 0.020833333333333332\right)\right)\right)\right)
\end{array}
Initial program 50.9%
Taylor expanded in x around 0 30.2%
mul-1-neg30.2%
unsub-neg30.2%
Simplified30.2%
Taylor expanded in x around 0 70.4%
*-commutative70.4%
Simplified70.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m) :precision binary64 (* x_s (/ (* x_m (+ 2.0 (* 0.3333333333333333 (* x_m x_m)))) 2.0)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * ((x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * ((x_m * (2.0d0 + (0.3333333333333333d0 * (x_m * x_m)))) / 2.0d0)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * ((x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0);
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * ((x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0)
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * Float64(Float64(x_m * Float64(2.0 + Float64(0.3333333333333333 * Float64(x_m * x_m)))) / 2.0)) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * ((x_m * (2.0 + (0.3333333333333333 * (x_m * x_m)))) / 2.0); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * N[(N[(x$95$m * N[(2.0 + N[(0.3333333333333333 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \frac{x\_m \cdot \left(2 + 0.3333333333333333 \cdot \left(x\_m \cdot x\_m\right)\right)}{2}
\end{array}
Initial program 50.9%
Taylor expanded in x around 0 86.5%
unpow292.7%
Applied egg-rr86.5%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m) :precision binary64 (* x_s (* x_m (+ 1.0 (* x_m 0.25)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * (x_m * (1.0 + (x_m * 0.25)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * (x_m * (1.0d0 + (x_m * 0.25d0)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * (x_m * (1.0 + (x_m * 0.25)));
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * (x_m * (1.0 + (x_m * 0.25)))
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * Float64(x_m * Float64(1.0 + Float64(x_m * 0.25)))) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * (x_m * (1.0 + (x_m * 0.25))); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * N[(x$95$m * N[(1.0 + N[(x$95$m * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \left(x\_m \cdot \left(1 + x\_m \cdot 0.25\right)\right)
\end{array}
Initial program 50.9%
Taylor expanded in x around 0 30.2%
mul-1-neg30.2%
unsub-neg30.2%
Simplified30.2%
Taylor expanded in x around 0 65.9%
*-commutative65.9%
Simplified65.9%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m) :precision binary64 (* x_s (/ (* x_m 2.0) 2.0)))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * ((x_m * 2.0) / 2.0);
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * ((x_m * 2.0d0) / 2.0d0)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * ((x_m * 2.0) / 2.0);
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * ((x_m * 2.0) / 2.0)
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * Float64(Float64(x_m * 2.0) / 2.0)) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * ((x_m * 2.0) / 2.0); end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * N[(N[(x$95$m * 2.0), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot \frac{x\_m \cdot 2}{2}
\end{array}
Initial program 50.9%
Taylor expanded in x around 0 56.4%
Final simplification56.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m) :precision binary64 (* x_s x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * x_m
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * x_m;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * x_m
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * x_m) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * x_m; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot x\_m
\end{array}
Initial program 50.9%
Taylor expanded in x around 0 86.5%
Taylor expanded in x around 0 56.1%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) (FPCore (x_s x_m) :precision binary64 (* x_s 13.0))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m) {
return x_s * 13.0;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m)
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
code = x_s * 13.0d0
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m) {
return x_s * 13.0;
}
x\_m = math.fabs(x) x\_s = math.copysign(1.0, x) def code(x_s, x_m): return x_s * 13.0
x\_m = abs(x) x\_s = copysign(1.0, x) function code(x_s, x_m) return Float64(x_s * 13.0) end
x\_m = abs(x); x\_s = sign(x) * abs(1.0); function tmp = code(x_s, x_m) tmp = x_s * 13.0; end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_] := N[(x$95$s * 13.0), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
x\_s \cdot 13
\end{array}
Initial program 50.9%
Applied egg-rr24.0%
Taylor expanded in x around 0 3.1%
herbie shell --seed 2024132
(FPCore (x)
:name "Hyperbolic sine"
:precision binary64
(/ (- (exp x) (exp (- x))) 2.0))