Average Error: 20.7 → 1.8
Time: 18.7s
Precision: 64
$\left(\left(k \gt 1 \land k \lt 20000.0\right) \land 0 \lt x\right) \land x \lt 1$
$\frac{\sinh \left(k \cdot \left(1 - x\right)\right)}{\sinh k}$
$1 - x$
\frac{\sinh \left(k \cdot \left(1 - x\right)\right)}{\sinh k}
1 - x
double f(double k, double x) {
double r31201416 = k;
double r31201417 = 1.0;
double r31201418 = x;
double r31201419 = r31201417 - r31201418;
double r31201420 = r31201416 * r31201419;
double r31201421 = sinh(r31201420);
double r31201422 = sinh(r31201416);
double r31201423 = r31201421 / r31201422;
return r31201423;
}


double f(double __attribute__((unused)) k, double x) {
double r31201424 = 1.0;
double r31201425 = x;
double r31201426 = r31201424 - r31201425;
return r31201426;
}



Try it out

Results

 In Out
Enter valid numbers for all inputs

Derivation

1. Initial program 20.7

$\frac{\sinh \left(k \cdot \left(1 - x\right)\right)}{\sinh k}$
2. Simplified20.7

$\leadsto \color{blue}{\frac{\sinh \left(k - k \cdot x\right)}{\sinh k}}$
3. Taylor expanded around 0 2.2

$\leadsto \color{blue}{1 - \left(x + \frac{1}{3} \cdot \left(x \cdot {k}^{2}\right)\right)}$
4. Simplified2.2

$\leadsto \color{blue}{\left(1 - x\right) - \left(x \cdot k\right) \cdot \left(\frac{1}{3} \cdot k\right)}$
5. Taylor expanded around 0 1.8

$\leadsto \color{blue}{1 - x}$
6. Final simplification1.8

$\leadsto 1 - x$

Reproduce

herbie shell --seed 1
(FPCore (k x)
:name "sinh(k * (1 - x)) / sinh(k)"
:pre (and (and (and (> k 1) (< k 20000.0)) (< 0 x)) (< x 1))
(/ (sinh (* k (- 1 x))) (sinh k)))