Average Error: 26.4 → 1.8
Time: 17.4s
Precision: 64
\[\left(\left(k \gt 1 \land k \lt 100000.0\right) \land 0 \lt x\right) \land x \lt 1\]
\[\frac{\sinh \left(k - k \cdot x\right)}{\sinh k}\]
\[1 - x\]
\frac{\sinh \left(k - k \cdot x\right)}{\sinh k}
1 - x
double f(double k, double x) {
        double r30639143 = k;
        double r30639144 = x;
        double r30639145 = r30639143 * r30639144;
        double r30639146 = r30639143 - r30639145;
        double r30639147 = sinh(r30639146);
        double r30639148 = sinh(r30639143);
        double r30639149 = r30639147 / r30639148;
        return r30639149;
}

double f(double __attribute__((unused)) k, double x) {
        double r30639150 = 1.0;
        double r30639151 = x;
        double r30639152 = r30639150 - r30639151;
        return r30639152;
}

Error

Bits error versus k

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 26.4

    \[\frac{\sinh \left(k - k \cdot x\right)}{\sinh k}\]
  2. Taylor expanded around 0 2.2

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

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

    \[\leadsto \color{blue}{1 - x}\]
  5. Final simplification1.8

    \[\leadsto 1 - x\]

Reproduce

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