Average Error: 13.1 → 0.3
Time: 35.1s
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{\cos a \cdot \left(\tan y + \tan z\right) - \left(1 - \tan z \cdot \tan y\right) \cdot \sin a}{\left(1 - \log \left(e^{\frac{\sin z \cdot \tan y}{\cos z}}\right)\right) \cdot \cos a} + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\cos a \cdot \left(\tan y + \tan z\right) - \left(1 - \tan z \cdot \tan y\right) \cdot \sin a}{\left(1 - \log \left(e^{\frac{\sin z \cdot \tan y}{\cos z}}\right)\right) \cdot \cos a} + x
double f(double x, double y, double z, double a) {
        double r6625470 = x;
        double r6625471 = y;
        double r6625472 = z;
        double r6625473 = r6625471 + r6625472;
        double r6625474 = tan(r6625473);
        double r6625475 = a;
        double r6625476 = tan(r6625475);
        double r6625477 = r6625474 - r6625476;
        double r6625478 = r6625470 + r6625477;
        return r6625478;
}

double f(double x, double y, double z, double a) {
        double r6625479 = a;
        double r6625480 = cos(r6625479);
        double r6625481 = y;
        double r6625482 = tan(r6625481);
        double r6625483 = z;
        double r6625484 = tan(r6625483);
        double r6625485 = r6625482 + r6625484;
        double r6625486 = r6625480 * r6625485;
        double r6625487 = 1.0;
        double r6625488 = r6625484 * r6625482;
        double r6625489 = r6625487 - r6625488;
        double r6625490 = sin(r6625479);
        double r6625491 = r6625489 * r6625490;
        double r6625492 = r6625486 - r6625491;
        double r6625493 = sin(r6625483);
        double r6625494 = r6625493 * r6625482;
        double r6625495 = cos(r6625483);
        double r6625496 = r6625494 / r6625495;
        double r6625497 = exp(r6625496);
        double r6625498 = log(r6625497);
        double r6625499 = r6625487 - r6625498;
        double r6625500 = r6625499 * r6625480;
        double r6625501 = r6625492 / r6625500;
        double r6625502 = x;
        double r6625503 = r6625501 + r6625502;
        return r6625503;
}

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 add-log-exp0.3

    \[\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}{\log \left(e^{\tan y \cdot \tan z}\right)}\right) \cdot \cos a}\]
  8. Using strategy rm
  9. Applied tan-quot0.3

    \[\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 - \log \left(e^{\tan y \cdot \color{blue}{\frac{\sin z}{\cos z}}}\right)\right) \cdot \cos a}\]
  10. Applied associate-*r/0.3

    \[\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 - \log \left(e^{\color{blue}{\frac{\tan y \cdot \sin z}{\cos z}}}\right)\right) \cdot \cos a}\]
  11. Final simplification0.3

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

Reproduce

herbie shell --seed 2019162 
(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))))