Average Error: 13.1 → 0.3
Time: 32.7s
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)\]
\[\log \left(e^{\frac{\cos y \cdot \sin z + \sin y \cdot \cos z}{\left(\cos z \cdot \cos y\right) \cdot \left(1 - \tan z \cdot \tan y\right)} - \tan a}\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{\frac{\cos y \cdot \sin z + \sin y \cdot \cos z}{\left(\cos z \cdot \cos y\right) \cdot \left(1 - \tan z \cdot \tan y\right)} - \tan a}\right) + x
double f(double x, double y, double z, double a) {
        double r128597 = x;
        double r128598 = y;
        double r128599 = z;
        double r128600 = r128598 + r128599;
        double r128601 = tan(r128600);
        double r128602 = a;
        double r128603 = tan(r128602);
        double r128604 = r128601 - r128603;
        double r128605 = r128597 + r128604;
        return r128605;
}

double f(double x, double y, double z, double a) {
        double r128606 = y;
        double r128607 = cos(r128606);
        double r128608 = z;
        double r128609 = sin(r128608);
        double r128610 = r128607 * r128609;
        double r128611 = sin(r128606);
        double r128612 = cos(r128608);
        double r128613 = r128611 * r128612;
        double r128614 = r128610 + r128613;
        double r128615 = r128612 * r128607;
        double r128616 = 1.0;
        double r128617 = tan(r128608);
        double r128618 = tan(r128606);
        double r128619 = r128617 * r128618;
        double r128620 = r128616 - r128619;
        double r128621 = r128615 * r128620;
        double r128622 = r128614 / r128621;
        double r128623 = a;
        double r128624 = tan(r128623);
        double r128625 = r128622 - r128624;
        double r128626 = exp(r128625);
        double r128627 = log(r128626);
        double r128628 = x;
        double r128629 = r128627 + r128628;
        return r128629;
}

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 13.1

    \[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{\tan y + \tan z}{\color{blue}{1 - \tan z \cdot \tan y}} - \tan a\right)\]
  5. Using strategy rm
  6. Applied tan-quot0.2

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

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

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

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

    \[\leadsto x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\color{blue}{\left(\cos y \cdot \cos z\right) \cdot \left(1 - \tan y \cdot \tan z\right)}} - \tan a\right)\]
  11. Using strategy rm
  12. Applied add-log-exp0.3

    \[\leadsto x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\left(\cos y \cdot \cos z\right) \cdot \left(1 - \tan y \cdot \tan z\right)} - \color{blue}{\log \left(e^{\tan a}\right)}\right)\]
  13. Applied add-log-exp0.3

    \[\leadsto x + \left(\color{blue}{\log \left(e^{\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\left(\cos y \cdot \cos z\right) \cdot \left(1 - \tan y \cdot \tan z\right)}}\right)} - \log \left(e^{\tan a}\right)\right)\]
  14. Applied diff-log0.3

    \[\leadsto x + \color{blue}{\log \left(\frac{e^{\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\left(\cos y \cdot \cos z\right) \cdot \left(1 - \tan y \cdot \tan z\right)}}}{e^{\tan a}}\right)}\]
  15. Simplified0.3

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

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

Reproduce

herbie shell --seed 2019194 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :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))))