Average Error: 2.8 → 1.8
Time: 15.9s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.02386663058320886942785091003252010013 \cdot 10^{79}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{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 \le -6.02386663058320886942785091003252010013 \cdot 10^{79}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r23320593 = x;
        double r23320594 = y;
        double r23320595 = sin(r23320594);
        double r23320596 = r23320595 / r23320594;
        double r23320597 = r23320593 * r23320596;
        double r23320598 = z;
        double r23320599 = r23320597 / r23320598;
        return r23320599;
}

double f(double x, double y, double z) {
        double r23320600 = x;
        double r23320601 = -6.023866630583209e+79;
        bool r23320602 = r23320600 <= r23320601;
        double r23320603 = y;
        double r23320604 = sin(r23320603);
        double r23320605 = r23320603 / r23320604;
        double r23320606 = r23320600 / r23320605;
        double r23320607 = z;
        double r23320608 = r23320606 / r23320607;
        double r23320609 = r23320604 / r23320603;
        double r23320610 = r23320607 / r23320609;
        double r23320611 = r23320600 / r23320610;
        double r23320612 = r23320602 ? r23320608 : r23320611;
        return r23320612;
}

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.8
Target0.3
Herbie1.8
\[\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 < -6.023866630583209e+79

    1. Initial program 0.2

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

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

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

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

    if -6.023866630583209e+79 < x

    1. Initial program 3.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -6.02386663058320886942785091003252010013 \cdot 10^{79}:\\ \;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\ \end{array}\]

Reproduce

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