Average Error: 2.7 → 0.7
Time: 8.1s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.36679473324426535 \cdot 10^{84}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\ \mathbf{elif}\;x \le 1.8458756307979711 \cdot 10^{111}:\\ \;\;\;\;x \cdot \frac{1}{\frac{z}{\frac{\sin y}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -1.36679473324426535 \cdot 10^{84}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\

\mathbf{elif}\;x \le 1.8458756307979711 \cdot 10^{111}:\\
\;\;\;\;x \cdot \frac{1}{\frac{z}{\frac{\sin y}{y}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r686716 = x;
        double r686717 = y;
        double r686718 = sin(r686717);
        double r686719 = r686718 / r686717;
        double r686720 = r686716 * r686719;
        double r686721 = z;
        double r686722 = r686720 / r686721;
        return r686722;
}

double f(double x, double y, double z) {
        double r686723 = x;
        double r686724 = -1.3667947332442653e+84;
        bool r686725 = r686723 <= r686724;
        double r686726 = 1.0;
        double r686727 = z;
        double r686728 = y;
        double r686729 = sin(r686728);
        double r686730 = r686729 / r686728;
        double r686731 = r686723 * r686730;
        double r686732 = r686727 / r686731;
        double r686733 = r686726 / r686732;
        double r686734 = 1.845875630797971e+111;
        bool r686735 = r686723 <= r686734;
        double r686736 = r686727 / r686730;
        double r686737 = r686726 / r686736;
        double r686738 = r686723 * r686737;
        double r686739 = r686723 * r686729;
        double r686740 = r686726 / r686728;
        double r686741 = r686739 * r686740;
        double r686742 = r686741 / r686727;
        double r686743 = r686735 ? r686738 : r686742;
        double r686744 = r686725 ? r686733 : r686743;
        return r686744;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.7
Target0.2
Herbie0.7
\[\begin{array}{l} \mathbf{if}\;z \lt -4.21737202034271466 \cdot 10^{-29}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;z \lt 4.44670236911381103 \cdot 10^{64}:\\ \;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if x < -1.3667947332442653e+84

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied clear-num0.4

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}}\]

    if -1.3667947332442653e+84 < x < 1.845875630797971e+111

    1. Initial program 3.6

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity3.6

      \[\leadsto \frac{x \cdot \frac{\sin y}{y}}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac0.7

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{\frac{\sin y}{y}}{z}}\]
    5. Simplified0.7

      \[\leadsto \color{blue}{x} \cdot \frac{\frac{\sin y}{y}}{z}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity0.7

      \[\leadsto x \cdot \frac{\frac{\sin y}{\color{blue}{1 \cdot y}}}{z}\]
    8. Applied *-un-lft-identity0.7

      \[\leadsto x \cdot \frac{\frac{\color{blue}{1 \cdot \sin y}}{1 \cdot y}}{z}\]
    9. Applied times-frac0.7

      \[\leadsto x \cdot \frac{\color{blue}{\frac{1}{1} \cdot \frac{\sin y}{y}}}{z}\]
    10. Applied associate-/l*0.8

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{1}}{\frac{z}{\frac{\sin y}{y}}}}\]

    if 1.845875630797971e+111 < x

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied div-inv0.3

      \[\leadsto \frac{x \cdot \color{blue}{\left(\sin y \cdot \frac{1}{y}\right)}}{z}\]
    4. Applied associate-*r*0.3

      \[\leadsto \frac{\color{blue}{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}}{z}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.36679473324426535 \cdot 10^{84}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\ \mathbf{elif}\;x \le 1.8458756307979711 \cdot 10^{111}:\\ \;\;\;\;x \cdot \frac{1}{\frac{z}{\frac{\sin y}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2020035 
(FPCore (x y z)
  :name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))

  (/ (* x (/ (sin y) y)) z))