Average Error: 13.1 → 0.3
Time: 12.7s
Precision: 64
\[\left(x = 0.0 \lor 0.588414199999999998 \le x \le 505.590899999999976\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le y \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.7512240000000001 \cdot 10^{308}\right) \land \left(-1.7767070000000002 \cdot 10^{308} \le z \le -8.59979600000002 \cdot 10^{-310} \lor 3.29314499999998 \cdot 10^{-311} \le z \le 1.72515400000000009 \cdot 10^{308}\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le a \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.7512240000000001 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\log \left(e^{x} \cdot \frac{{\left(e^{\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}}\right)}^{\left(1 + \tan y \cdot \tan z\right)}}{e^{\tan a}}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{x} \cdot \frac{{\left(e^{\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}}\right)}^{\left(1 + \tan y \cdot \tan z\right)}}{e^{\tan a}}\right)
double f(double x, double y, double z, double a) {
        double r249798 = x;
        double r249799 = y;
        double r249800 = z;
        double r249801 = r249799 + r249800;
        double r249802 = tan(r249801);
        double r249803 = a;
        double r249804 = tan(r249803);
        double r249805 = r249802 - r249804;
        double r249806 = r249798 + r249805;
        return r249806;
}

double f(double x, double y, double z, double a) {
        double r249807 = x;
        double r249808 = exp(r249807);
        double r249809 = y;
        double r249810 = tan(r249809);
        double r249811 = z;
        double r249812 = tan(r249811);
        double r249813 = r249810 + r249812;
        double r249814 = 1.0;
        double r249815 = r249810 * r249812;
        double r249816 = r249815 * r249815;
        double r249817 = r249814 - r249816;
        double r249818 = r249813 / r249817;
        double r249819 = exp(r249818);
        double r249820 = r249814 + r249815;
        double r249821 = pow(r249819, r249820);
        double r249822 = a;
        double r249823 = tan(r249822);
        double r249824 = exp(r249823);
        double r249825 = r249821 / r249824;
        double r249826 = r249808 * r249825;
        double r249827 = log(r249826);
        return r249827;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \log \left(e^{x} \cdot \frac{e^{\frac{\tan y + \tan z}{\color{blue}{\frac{1 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}{1 + \tan y \cdot \tan z}}}}}{e^{\tan a}}\right)\]
  20. Applied associate-/r/0.3

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

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

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

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

Reproduce

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