# ?

Average Error: 0.9 → 0.3
Time: 5.2s
Precision: binary64
Cost: 6592

# ?

$0.01 \leq x \land x \leq 708$
$\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 0.9

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

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

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

# Alternatives

Alternative 1
Error50.9
Cost832
$\left(1 + \left(x \cdot 0.5 + \frac{1}{x}\right)\right) + \frac{-1}{x}$
Alternative 2
Error50.9
Cost320
$1 + x \cdot 0.5$
Alternative 3
Error53.2
Cost64
$1$

# Reproduce?

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