Average Error: 13.1 → 0.3
Time: 39.0s
Precision: 64
\[\left(x = 0 \lor 0.5884142 \le x \le 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \le y \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.751224 \cdot 10^{+308}\right) \land \left(-1.776707 \cdot 10^{+308} \le z \le -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \le z \le 1.725154 \cdot 10^{+308}\right) \land \left(-1.796658 \cdot 10^{+308} \le a \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.751224 \cdot 10^{+308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\frac{\log \left(e^{\cos a \cdot \left(\tan y + \tan z\right)}\right) - \sin a \cdot \left(1 - \tan z \cdot \tan y\right)}{\left(1 - \frac{\sin z \cdot \tan y}{\cos z}\right) \cdot \cos a} + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\log \left(e^{\cos a \cdot \left(\tan y + \tan z\right)}\right) - \sin a \cdot \left(1 - \tan z \cdot \tan y\right)}{\left(1 - \frac{\sin z \cdot \tan y}{\cos z}\right) \cdot \cos a} + x
double f(double x, double y, double z, double a) {
        double r5346524 = x;
        double r5346525 = y;
        double r5346526 = z;
        double r5346527 = r5346525 + r5346526;
        double r5346528 = tan(r5346527);
        double r5346529 = a;
        double r5346530 = tan(r5346529);
        double r5346531 = r5346528 - r5346530;
        double r5346532 = r5346524 + r5346531;
        return r5346532;
}

double f(double x, double y, double z, double a) {
        double r5346533 = a;
        double r5346534 = cos(r5346533);
        double r5346535 = y;
        double r5346536 = tan(r5346535);
        double r5346537 = z;
        double r5346538 = tan(r5346537);
        double r5346539 = r5346536 + r5346538;
        double r5346540 = r5346534 * r5346539;
        double r5346541 = exp(r5346540);
        double r5346542 = log(r5346541);
        double r5346543 = sin(r5346533);
        double r5346544 = 1.0;
        double r5346545 = r5346538 * r5346536;
        double r5346546 = r5346544 - r5346545;
        double r5346547 = r5346543 * r5346546;
        double r5346548 = r5346542 - r5346547;
        double r5346549 = sin(r5346537);
        double r5346550 = r5346549 * r5346536;
        double r5346551 = cos(r5346537);
        double r5346552 = r5346550 / r5346551;
        double r5346553 = r5346544 - r5346552;
        double r5346554 = r5346553 * r5346534;
        double r5346555 = r5346548 / r5346554;
        double r5346556 = x;
        double r5346557 = r5346555 + r5346556;
        return r5346557;
}

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-quot13.1

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 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))))