Average Error: 18.3 → 2.0
Time: 17.9s
Precision: 64
\[\left|\sin x - \frac{\left(16 \cdot x\right) \cdot \left(\pi - x\right)}{5 \cdot {\pi}^{2} - \left(4 \cdot x\right) \cdot \left(\pi - x\right)}\right|\]
\[\left|\sin x - \frac{16}{\frac{5 \cdot {\pi}^{2}}{\pi - x} - x \cdot 4} \cdot x\right|\]
\left|\sin x - \frac{\left(16 \cdot x\right) \cdot \left(\pi - x\right)}{5 \cdot {\pi}^{2} - \left(4 \cdot x\right) \cdot \left(\pi - x\right)}\right|
\left|\sin x - \frac{16}{\frac{5 \cdot {\pi}^{2}}{\pi - x} - x \cdot 4} \cdot x\right|
double f(double x) {
        double r371419 = x;
        double r371420 = sin(r371419);
        double r371421 = 16.0;
        double r371422 = r371421 * r371419;
        double r371423 = atan2(1.0, 0.0);
        double r371424 = r371423 - r371419;
        double r371425 = r371422 * r371424;
        double r371426 = 5.0;
        double r371427 = 2.0;
        double r371428 = pow(r371423, r371427);
        double r371429 = r371426 * r371428;
        double r371430 = 4.0;
        double r371431 = r371430 * r371419;
        double r371432 = r371431 * r371424;
        double r371433 = r371429 - r371432;
        double r371434 = r371425 / r371433;
        double r371435 = r371420 - r371434;
        double r371436 = fabs(r371435);
        return r371436;
}

double f(double x) {
        double r371437 = x;
        double r371438 = sin(r371437);
        double r371439 = 16.0;
        double r371440 = 5.0;
        double r371441 = atan2(1.0, 0.0);
        double r371442 = 2.0;
        double r371443 = pow(r371441, r371442);
        double r371444 = r371440 * r371443;
        double r371445 = r371441 - r371437;
        double r371446 = r371444 / r371445;
        double r371447 = 4.0;
        double r371448 = r371437 * r371447;
        double r371449 = r371446 - r371448;
        double r371450 = r371439 / r371449;
        double r371451 = r371450 * r371437;
        double r371452 = r371438 - r371451;
        double r371453 = fabs(r371452);
        return r371453;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 18.3

    \[\left|\sin x - \frac{\left(16 \cdot x\right) \cdot \left(\pi - x\right)}{5 \cdot {\pi}^{2} - \left(4 \cdot x\right) \cdot \left(\pi - x\right)}\right|\]
  2. Simplified2.0

    \[\leadsto \color{blue}{\left|\sin x - \frac{16}{\frac{5 \cdot {\pi}^{2}}{\pi - x} - x \cdot 4} \cdot x\right|}\]
  3. Final simplification2.0

    \[\leadsto \left|\sin x - \frac{16}{\frac{5 \cdot {\pi}^{2}}{\pi - x} - x \cdot 4} \cdot x\right|\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "abs(sin(x)-(16*x*(PI-x))/(5*PI^2-4*x*(PI-x)))"
  :precision binary64
  (fabs (- (sin x) (/ (* (* 16 x) (- PI x)) (- (* 5 (pow PI 2)) (* (* 4 x) (- PI x)))))))