Average Error: 13.1 → 0.3
Time: 32.7s
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 r7045765 = x;
        double r7045766 = y;
        double r7045767 = z;
        double r7045768 = r7045766 + r7045767;
        double r7045769 = tan(r7045768);
        double r7045770 = a;
        double r7045771 = tan(r7045770);
        double r7045772 = r7045769 - r7045771;
        double r7045773 = r7045765 + r7045772;
        return r7045773;
}

double f(double x, double y, double z, double a) {
        double r7045774 = a;
        double r7045775 = cos(r7045774);
        double r7045776 = y;
        double r7045777 = tan(r7045776);
        double r7045778 = z;
        double r7045779 = tan(r7045778);
        double r7045780 = r7045777 + r7045779;
        double r7045781 = r7045775 * r7045780;
        double r7045782 = 1.0;
        double r7045783 = r7045779 * r7045777;
        double r7045784 = r7045782 - r7045783;
        double r7045785 = sin(r7045774);
        double r7045786 = r7045784 * r7045785;
        double r7045787 = r7045781 - r7045786;
        double r7045788 = sin(r7045778);
        double r7045789 = r7045788 * r7045777;
        double r7045790 = cos(r7045778);
        double r7045791 = r7045789 / r7045790;
        double r7045792 = exp(r7045791);
        double r7045793 = log(r7045792);
        double r7045794 = r7045782 - r7045793;
        double r7045795 = r7045794 * r7045775;
        double r7045796 = r7045787 / r7045795;
        double r7045797 = x;
        double r7045798 = r7045796 + r7045797;
        return r7045798;
}

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))))