Average Error: 13.3 → 0.2
Time: 23.3s
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.751224000000000127647232028319723370461 \cdot 10^{308}\right) \land \left(-1.776707000000000200843839711454021982841 \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.751224000000000127647232028319723370461 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \frac{\left(\tan a + \frac{\tan z + \tan y}{1 - \tan z \cdot \tan y}\right) \cdot \left(\frac{\tan z + \tan y}{1 - \tan z \cdot \tan y} - \tan a\right)}{\tan a + \frac{\tan z + \tan y}{1 - \tan z \cdot \tan y}}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\tan a + \frac{\tan z + \tan y}{1 - \tan z \cdot \tan y}\right) \cdot \left(\frac{\tan z + \tan y}{1 - \tan z \cdot \tan y} - \tan a\right)}{\tan a + \frac{\tan z + \tan y}{1 - \tan z \cdot \tan y}}
double f(double x, double y, double z, double a) {
        double r99845 = x;
        double r99846 = y;
        double r99847 = z;
        double r99848 = r99846 + r99847;
        double r99849 = tan(r99848);
        double r99850 = a;
        double r99851 = tan(r99850);
        double r99852 = r99849 - r99851;
        double r99853 = r99845 + r99852;
        return r99853;
}

double f(double x, double y, double z, double a) {
        double r99854 = x;
        double r99855 = a;
        double r99856 = tan(r99855);
        double r99857 = z;
        double r99858 = tan(r99857);
        double r99859 = y;
        double r99860 = tan(r99859);
        double r99861 = r99858 + r99860;
        double r99862 = 1.0;
        double r99863 = r99858 * r99860;
        double r99864 = r99862 - r99863;
        double r99865 = r99861 / r99864;
        double r99866 = r99856 + r99865;
        double r99867 = r99865 - r99856;
        double r99868 = r99866 * r99867;
        double r99869 = r99868 / r99866;
        double r99870 = r99854 + r99869;
        return r99870;
}

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

    \[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{\color{blue}{\tan z + \tan y}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  5. Simplified0.2

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

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

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

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

    \[\leadsto x + \left(\frac{\log \color{blue}{\left(e^{\tan z + \tan y}\right)}}{1 - \tan z \cdot \tan y} - \tan a\right)\]
  11. Using strategy rm
  12. Applied flip--0.3

    \[\leadsto x + \color{blue}{\frac{\frac{\log \left(e^{\tan z + \tan y}\right)}{1 - \tan z \cdot \tan y} \cdot \frac{\log \left(e^{\tan z + \tan y}\right)}{1 - \tan z \cdot \tan y} - \tan a \cdot \tan a}{\frac{\log \left(e^{\tan z + \tan y}\right)}{1 - \tan z \cdot \tan y} + \tan a}}\]
  13. Simplified2.7

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

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

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

Reproduce

herbie shell --seed 2019347 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.7512240000000001e+308)) (or (<= -1.7767070000000002e+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.7512240000000001e+308)))
  (+ x (- (tan (+ y z)) (tan a))))