Average Error: 2.6 → 0.6
Time: 4.3s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.537263057677357 \cdot 10^{-28}:\\ \;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\ \mathbf{elif}\;x \le 3.8285680046076358 \cdot 10^{167}:\\ \;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -3.537263057677357 \cdot 10^{-28}:\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\

\mathbf{elif}\;x \le 3.8285680046076358 \cdot 10^{167}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\

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

\end{array}
double f(double x, double y, double z) {
        double r610215 = x;
        double r610216 = y;
        double r610217 = sin(r610216);
        double r610218 = r610217 / r610216;
        double r610219 = r610215 * r610218;
        double r610220 = z;
        double r610221 = r610219 / r610220;
        return r610221;
}

double f(double x, double y, double z) {
        double r610222 = x;
        double r610223 = -3.5372630576773575e-28;
        bool r610224 = r610222 <= r610223;
        double r610225 = y;
        double r610226 = sin(r610225);
        double r610227 = r610226 / r610225;
        double r610228 = r610222 * r610227;
        double r610229 = z;
        double r610230 = r610228 / r610229;
        double r610231 = 3.828568004607636e+167;
        bool r610232 = r610222 <= r610231;
        double r610233 = r610229 / r610227;
        double r610234 = r610222 / r610233;
        double r610235 = 1.0;
        double r610236 = r610229 / r610228;
        double r610237 = r610235 / r610236;
        double r610238 = r610232 ? r610234 : r610237;
        double r610239 = r610224 ? r610230 : r610238;
        return r610239;
}

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.3
Herbie0.6
\[\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 < -3.5372630576773575e-28

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*5.5

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}}\]
    4. Using strategy rm
    5. Applied associate-/r/5.7

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}}\]
    6. Using strategy rm
    7. Applied associate-*l/0.2

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

    if -3.5372630576773575e-28 < x < 3.828568004607636e+167

    1. Initial program 3.9

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*0.7

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

    if 3.828568004607636e+167 < x

    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}}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3.537263057677357 \cdot 10^{-28}:\\ \;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\ \mathbf{elif}\;x \le 3.8285680046076358 \cdot 10^{167}:\\ \;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\ \end{array}\]

Reproduce

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