Average Error: 0.0 → 0.0
Time: 16.7s
Precision: 64
\[\frac{-157079632679}{100000000000} \lt x \lt \frac{157079632679}{100000000000}\]
\[\left(\left(x - \frac{\left(x \cdot x\right) \cdot x}{6}\right) + \frac{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{120}\right) - \frac{\left(\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{5040}\]
\[x - \left(\frac{\left(x \cdot x\right) \cdot x}{6} + \left(\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}{5040} - \frac{x \cdot x}{120}\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\]
\left(\left(x - \frac{\left(x \cdot x\right) \cdot x}{6}\right) + \frac{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{120}\right) - \frac{\left(\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{5040}
x - \left(\frac{\left(x \cdot x\right) \cdot x}{6} + \left(\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}{5040} - \frac{x \cdot x}{120}\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)
double f(double x) {
        double r37340297 = x;
        double r37340298 = r37340297 * r37340297;
        double r37340299 = r37340298 * r37340297;
        double r37340300 = 6.0;
        double r37340301 = r37340299 / r37340300;
        double r37340302 = r37340297 - r37340301;
        double r37340303 = r37340299 * r37340297;
        double r37340304 = r37340303 * r37340297;
        double r37340305 = 120.0;
        double r37340306 = r37340304 / r37340305;
        double r37340307 = r37340302 + r37340306;
        double r37340308 = r37340304 * r37340297;
        double r37340309 = r37340308 * r37340297;
        double r37340310 = 5040.0;
        double r37340311 = r37340309 / r37340310;
        double r37340312 = r37340307 - r37340311;
        return r37340312;
}

double f(double x) {
        double r37340313 = x;
        double r37340314 = r37340313 * r37340313;
        double r37340315 = r37340314 * r37340313;
        double r37340316 = 6.0;
        double r37340317 = r37340315 / r37340316;
        double r37340318 = r37340314 * r37340314;
        double r37340319 = 5040.0;
        double r37340320 = r37340318 / r37340319;
        double r37340321 = 120.0;
        double r37340322 = r37340314 / r37340321;
        double r37340323 = r37340320 - r37340322;
        double r37340324 = r37340323 * r37340315;
        double r37340325 = r37340317 + r37340324;
        double r37340326 = r37340313 - r37340325;
        return r37340326;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(\left(x - \frac{\left(x \cdot x\right) \cdot x}{6}\right) + \frac{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{120}\right) - \frac{\left(\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x\right) \cdot x}{5040}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{x - \left(\frac{x \cdot \left(x \cdot x\right)}{6} + \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}{5040} - \frac{x \cdot x}{120}\right)\right)}\]
  3. Final simplification0.0

    \[\leadsto x - \left(\frac{\left(x \cdot x\right) \cdot x}{6} + \left(\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}{5040} - \frac{x \cdot x}{120}\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "sine"
  :pre (< -157079632679/100000000000 x 157079632679/100000000000)
  (- (+ (- x (/ (* (* x x) x) 6)) (/ (* (* (* (* x x) x) x) x) 120)) (/ (* (* (* (* (* (* x x) x) x) x) x) x) 5040)))