Average Error: 12.9 → 0.2
Time: 27.5s
Precision: 64
\[\left(x = 0.0 \lor 0.5884141999999999983472775966220069676638 \le x \le 505.5908999999999764440872240811586380005\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le y \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le y \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right) \land \left(-1.776707000000000001259808757982040817204 \cdot 10^{308} \le z \le -8.599796000000016667475923823712126825539 \cdot 10^{-310} \lor 3.293144999999983071955117582595641261776 \cdot 10^{-311} \le z \le 1.725154000000000087891269878141591702413 \cdot 10^{308}\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le a \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le a \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \left(\frac{\tan z + \tan y}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\tan z + \tan y}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) - \tan a\right)
double f(double x, double y, double z, double a) {
        double r104312 = x;
        double r104313 = y;
        double r104314 = z;
        double r104315 = r104313 + r104314;
        double r104316 = tan(r104315);
        double r104317 = a;
        double r104318 = tan(r104317);
        double r104319 = r104316 - r104318;
        double r104320 = r104312 + r104319;
        return r104320;
}

double f(double x, double y, double z, double a) {
        double r104321 = x;
        double r104322 = z;
        double r104323 = tan(r104322);
        double r104324 = y;
        double r104325 = tan(r104324);
        double r104326 = r104323 + r104325;
        double r104327 = 1.0;
        double r104328 = sin(r104324);
        double r104329 = sin(r104322);
        double r104330 = r104328 * r104329;
        double r104331 = cos(r104322);
        double r104332 = cos(r104324);
        double r104333 = r104331 * r104332;
        double r104334 = r104330 / r104333;
        double r104335 = r104323 * r104325;
        double r104336 = r104334 * r104335;
        double r104337 = r104327 - r104336;
        double r104338 = r104326 / r104337;
        double r104339 = r104327 + r104334;
        double r104340 = r104338 * r104339;
        double r104341 = a;
        double r104342 = tan(r104341);
        double r104343 = r104340 - r104342;
        double r104344 = r104321 + r104343;
        return r104344;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 12.9

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-sum0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \tan a\right)\]
  4. Simplified0.2

    \[\leadsto x + \left(\frac{\color{blue}{\tan z + \tan y}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  5. Simplified0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{\color{blue}{1 - \tan z \cdot \tan y}} - \tan a\right)\]
  6. Using strategy rm
  7. Applied flip--0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{\color{blue}{\frac{1 \cdot 1 - \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)}{1 + \tan z \cdot \tan y}}} - \tan a\right)\]
  8. Applied associate-/r/0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan z + \tan y}{1 \cdot 1 - \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \tan z \cdot \tan y\right)} - \tan a\right)\]
  9. Simplified0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan z + \tan y}{1 - \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)}} \cdot \left(1 + \tan z \cdot \tan y\right) - \tan a\right)\]
  10. Using strategy rm
  11. Applied tan-quot0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \left(\tan z \cdot \color{blue}{\frac{\sin y}{\cos y}}\right) \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \tan z \cdot \tan y\right) - \tan a\right)\]
  12. Applied tan-quot0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \left(\color{blue}{\frac{\sin z}{\cos z}} \cdot \frac{\sin y}{\cos y}\right) \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \tan z \cdot \tan y\right) - \tan a\right)\]
  13. Applied frac-times0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \color{blue}{\frac{\sin z \cdot \sin y}{\cos z \cdot \cos y}} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \tan z \cdot \tan y\right) - \tan a\right)\]
  14. Simplified0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \frac{\color{blue}{\sin y \cdot \sin z}}{\cos z \cdot \cos y} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \tan z \cdot \tan y\right) - \tan a\right)\]
  15. Taylor expanded around inf 0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \color{blue}{\frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}\right) - \tan a\right)\]
  16. Final simplification0.2

    \[\leadsto x + \left(\frac{\tan z + \tan y}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(1 + \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) - \tan a\right)\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.751224e+308)) (or (<= -1.776707e+308 z -8.599796e-310) (<= 3.293145e-311 z 1.725154e+308)) (or (<= -1.796658e+308 a -9.425585e-310) (<= 1.284938e-309 a 1.751224e+308)))
  (+ x (- (tan (+ y z)) (tan a))))