Average Error: 2.6 → 1.0
Time: 18.9s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.534022103388537785324346726232718774281 \cdot 10^{-197} \lor \neg \left(x \le 3.919669597540599981300396099712880953519 \cdot 10^{-124}\right):\\ \;\;\;\;\frac{\frac{-x}{\frac{y}{\sin y}}}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -1.534022103388537785324346726232718774281 \cdot 10^{-197} \lor \neg \left(x \le 3.919669597540599981300396099712880953519 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{\frac{-x}{\frac{y}{\sin y}}}{-z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r434540 = x;
        double r434541 = y;
        double r434542 = sin(r434541);
        double r434543 = r434542 / r434541;
        double r434544 = r434540 * r434543;
        double r434545 = z;
        double r434546 = r434544 / r434545;
        return r434546;
}

double f(double x, double y, double z) {
        double r434547 = x;
        double r434548 = -1.5340221033885378e-197;
        bool r434549 = r434547 <= r434548;
        double r434550 = 3.9196695975406e-124;
        bool r434551 = r434547 <= r434550;
        double r434552 = !r434551;
        bool r434553 = r434549 || r434552;
        double r434554 = -r434547;
        double r434555 = y;
        double r434556 = sin(r434555);
        double r434557 = r434555 / r434556;
        double r434558 = r434554 / r434557;
        double r434559 = z;
        double r434560 = -r434559;
        double r434561 = r434558 / r434560;
        double r434562 = r434559 * r434557;
        double r434563 = r434547 / r434562;
        double r434564 = r434553 ? r434561 : r434563;
        return r434564;
}

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
Herbie1.0
\[\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 < -1.5340221033885378e-197 or 3.9196695975406e-124 < x

    1. Initial program 1.2

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}}}{z}\]
    4. Using strategy rm
    5. Applied frac-2neg1.3

      \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{\frac{y}{\sin y}}}{-z}}\]
    6. Simplified1.3

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

    if -1.5340221033885378e-197 < x < 3.9196695975406e-124

    1. Initial program 6.5

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}}}{z}\]
    4. Using strategy rm
    5. Applied associate-/l*0.1

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

      \[\leadsto \frac{x}{\color{blue}{z \cdot \frac{y}{\sin y}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.534022103388537785324346726232718774281 \cdot 10^{-197} \lor \neg \left(x \le 3.919669597540599981300396099712880953519 \cdot 10^{-124}\right):\\ \;\;\;\;\frac{\frac{-x}{\frac{y}{\sin y}}}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))

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