Average Error: 13.2 → 0.2
Time: 32.6s
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{\sin y}{\cos y \cdot \left(1 - \frac{\sin z}{\cos y} \cdot \frac{\sin y}{\cos z}\right)} - \left(\frac{\sin a}{\cos a} - \frac{\frac{\sin z}{\cos z}}{1 - \frac{\sin z}{\cos y} \cdot \frac{\sin y}{\cos z}}\right)\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\sin y}{\cos y \cdot \left(1 - \frac{\sin z}{\cos y} \cdot \frac{\sin y}{\cos z}\right)} - \left(\frac{\sin a}{\cos a} - \frac{\frac{\sin z}{\cos z}}{1 - \frac{\sin z}{\cos y} \cdot \frac{\sin y}{\cos z}}\right)\right)
double f(double x, double y, double z, double a) {
        double r98764 = x;
        double r98765 = y;
        double r98766 = z;
        double r98767 = r98765 + r98766;
        double r98768 = tan(r98767);
        double r98769 = a;
        double r98770 = tan(r98769);
        double r98771 = r98768 - r98770;
        double r98772 = r98764 + r98771;
        return r98772;
}

double f(double x, double y, double z, double a) {
        double r98773 = x;
        double r98774 = y;
        double r98775 = sin(r98774);
        double r98776 = cos(r98774);
        double r98777 = 1.0;
        double r98778 = z;
        double r98779 = sin(r98778);
        double r98780 = r98779 / r98776;
        double r98781 = cos(r98778);
        double r98782 = r98775 / r98781;
        double r98783 = r98780 * r98782;
        double r98784 = r98777 - r98783;
        double r98785 = r98776 * r98784;
        double r98786 = r98775 / r98785;
        double r98787 = a;
        double r98788 = sin(r98787);
        double r98789 = cos(r98787);
        double r98790 = r98788 / r98789;
        double r98791 = r98779 / r98781;
        double r98792 = r98791 / r98784;
        double r98793 = r98790 - r98792;
        double r98794 = r98786 - r98793;
        double r98795 = r98773 + r98794;
        return r98795;
}

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-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. Taylor expanded around inf 0.2

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

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

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

Reproduce

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