Average Error: 2.6 → 0.3
Time: 4.4s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.155566547691587058014765982566123084784 \cdot 10^{-290} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.212547594237189431415383106313707223784 \cdot 10^{-152}\right):\\ \;\;\;\;\frac{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.155566547691587058014765982566123084784 \cdot 10^{-290} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.212547594237189431415383106313707223784 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}{z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r474670 = x;
        double r474671 = y;
        double r474672 = sin(r474671);
        double r474673 = r474672 / r474671;
        double r474674 = r474670 * r474673;
        double r474675 = z;
        double r474676 = r474674 / r474675;
        return r474676;
}

double f(double x, double y, double z) {
        double r474677 = x;
        double r474678 = y;
        double r474679 = sin(r474678);
        double r474680 = r474679 / r474678;
        double r474681 = r474677 * r474680;
        double r474682 = -2.155566547691587e-290;
        bool r474683 = r474681 <= r474682;
        double r474684 = 2.2125475942371894e-152;
        bool r474685 = r474681 <= r474684;
        double r474686 = !r474685;
        bool r474687 = r474683 || r474686;
        double r474688 = 1.0;
        double r474689 = r474678 / r474679;
        double r474690 = r474688 / r474689;
        double r474691 = r474677 * r474690;
        double r474692 = r474688 * r474691;
        double r474693 = z;
        double r474694 = r474692 / r474693;
        double r474695 = r474693 / r474680;
        double r474696 = r474677 / r474695;
        double r474697 = r474687 ? r474694 : r474696;
        return r474697;
}

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.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)) < -2.155566547691587e-290 or 2.2125475942371894e-152 < (* x (/ (sin y) y))

    1. Initial program 0.2

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

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

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

      \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}}{z}\]
    7. Simplified0.2

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

      \[\leadsto \frac{1 \cdot \color{blue}{\left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}}{z}\]

    if -2.155566547691587e-290 < (* x (/ (sin y) y)) < 2.2125475942371894e-152

    1. Initial program 8.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.155566547691587058014765982566123084784 \cdot 10^{-290} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.212547594237189431415383106313707223784 \cdot 10^{-152}\right):\\ \;\;\;\;\frac{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\ \end{array}\]

Reproduce

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