Average Error: 13.2 → 0.2
Time: 41.8s
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{\frac{\cos a}{\frac{1 - \tan z \cdot \tan y}{\tan y + \tan z}} - \sin a}{\cos a} + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\frac{\cos a}{\frac{1 - \tan z \cdot \tan y}{\tan y + \tan z}} - \sin a}{\cos a} + x
double f(double x, double y, double z, double a) {
        double r6796574 = x;
        double r6796575 = y;
        double r6796576 = z;
        double r6796577 = r6796575 + r6796576;
        double r6796578 = tan(r6796577);
        double r6796579 = a;
        double r6796580 = tan(r6796579);
        double r6796581 = r6796578 - r6796580;
        double r6796582 = r6796574 + r6796581;
        return r6796582;
}

double f(double x, double y, double z, double a) {
        double r6796583 = a;
        double r6796584 = cos(r6796583);
        double r6796585 = 1.0;
        double r6796586 = z;
        double r6796587 = tan(r6796586);
        double r6796588 = y;
        double r6796589 = tan(r6796588);
        double r6796590 = r6796587 * r6796589;
        double r6796591 = r6796585 - r6796590;
        double r6796592 = r6796589 + r6796587;
        double r6796593 = r6796591 / r6796592;
        double r6796594 = r6796584 / r6796593;
        double r6796595 = sin(r6796583);
        double r6796596 = r6796594 - r6796595;
        double r6796597 = r6796596 / r6796584;
        double r6796598 = x;
        double r6796599 = r6796597 + r6796598;
        return r6796599;
}

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.2

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

    \[\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 associate-/r*0.2

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

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

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

Reproduce

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