# ?

Average Error: 1.1 → 0.2
Time: 4.5s
Precision: binary64
Cost: 6592

# ?

$0.01 \leq x \land x \leq 100$
$\frac{e^{x} - 1}{x}$
$\frac{\mathsf{expm1}\left(x\right)}{x}$
(FPCore (x) :precision binary64 (/ (- (exp x) 1.0) x))
(FPCore (x) :precision binary64 (/ (expm1 x) x))
double code(double x) {
return (exp(x) - 1.0) / x;
}

double code(double x) {
return expm1(x) / x;
}

public static double code(double x) {
return (Math.exp(x) - 1.0) / x;
}

public static double code(double x) {
return Math.expm1(x) / x;
}

def code(x):
return (math.exp(x) - 1.0) / x

def code(x):
return math.expm1(x) / x

function code(x)
return Float64(Float64(exp(x) - 1.0) / x)
end

function code(x)
return Float64(expm1(x) / x)
end

code[x_] := N[(N[(N[Exp[x], $MachinePrecision] - 1.0),$MachinePrecision] / x), $MachinePrecision]  code[x_] := N[(N[(Exp[x] - 1),$MachinePrecision] / x), \$MachinePrecision]

\frac{e^{x} - 1}{x}

\frac{\mathsf{expm1}\left(x\right)}{x}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 1.1

$\frac{e^{x} - 1}{x}$
2. Simplified0.2

$\leadsto \color{blue}{\frac{\mathsf{expm1}\left(x\right)}{x}}$
Proof
[Start]1.1 $\frac{e^{x} - 1}{x}$ $\frac{\color{blue}{\mathsf{expm1}\left(x\right)}}{x}$
3. Final simplification0.2

$\leadsto \frac{\mathsf{expm1}\left(x\right)}{x}$

# Alternatives

Alternative 1
Error48.8
Cost320
$x \cdot 0.5 + 1$
Alternative 2
Error51.6
Cost64
$1$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "(exp(x)-1)/x"
:precision binary64
:pre (and (<= 0.01 x) (<= x 100.0))
(/ (- (exp x) 1.0) x))