Average Error: 2.6 → 0.3
Time: 18.6s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \cdot x \le -9.952501648391637084358678946699592551584 \cdot 10^{-273}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;\frac{\sin y}{y} \cdot x \le -0.0:\\ \;\;\;\;x \cdot \left(\left(\sin y \cdot \frac{1}{y}\right) \cdot \frac{1}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;\frac{\sin y}{y} \cdot x \le -9.952501648391637084358678946699592551584 \cdot 10^{-273}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\

\mathbf{elif}\;\frac{\sin y}{y} \cdot x \le -0.0:\\
\;\;\;\;x \cdot \left(\left(\sin y \cdot \frac{1}{y}\right) \cdot \frac{1}{z}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\

\end{array}
double f(double x, double y, double z) {
        double r24753896 = x;
        double r24753897 = y;
        double r24753898 = sin(r24753897);
        double r24753899 = r24753898 / r24753897;
        double r24753900 = r24753896 * r24753899;
        double r24753901 = z;
        double r24753902 = r24753900 / r24753901;
        return r24753902;
}

double f(double x, double y, double z) {
        double r24753903 = y;
        double r24753904 = sin(r24753903);
        double r24753905 = r24753904 / r24753903;
        double r24753906 = x;
        double r24753907 = r24753905 * r24753906;
        double r24753908 = -9.952501648391637e-273;
        bool r24753909 = r24753907 <= r24753908;
        double r24753910 = r24753903 / r24753904;
        double r24753911 = r24753906 / r24753910;
        double r24753912 = z;
        double r24753913 = r24753911 / r24753912;
        double r24753914 = -0.0;
        bool r24753915 = r24753907 <= r24753914;
        double r24753916 = 1.0;
        double r24753917 = r24753916 / r24753903;
        double r24753918 = r24753904 * r24753917;
        double r24753919 = r24753916 / r24753912;
        double r24753920 = r24753918 * r24753919;
        double r24753921 = r24753906 * r24753920;
        double r24753922 = r24753915 ? r24753921 : r24753913;
        double r24753923 = r24753909 ? r24753913 : r24753922;
        return r24753923;
}

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.6
Target0.2
Herbie0.3
\[\begin{array}{l} \mathbf{if}\;z \lt -4.217372020342714661850238929213415773451 \cdot 10^{-29}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;z \lt 4.446702369113811028051510715777703865332 \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 2 regimes
  2. if (* x (/ (sin y) y)) < -9.952501648391637e-273 or -0.0 < (* x (/ (sin y) y))

    1. Initial program 0.3

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

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

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

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

    if -9.952501648391637e-273 < (* x (/ (sin y) y)) < -0.0

    1. Initial program 14.9

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

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{\frac{\sin y}{y}}{z}\]
    6. Using strategy rm
    7. Applied div-inv0.3

      \[\leadsto x \cdot \color{blue}{\left(\frac{\sin y}{y} \cdot \frac{1}{z}\right)}\]
    8. Using strategy rm
    9. Applied div-inv0.3

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

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

Reproduce

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

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

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