Average Error: 2.8 → 1.0
Time: 20.7s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.2889274271188022 \cdot 10^{+17}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{elif}\;x \le 1.5442293158046647 \cdot 10^{+242}:\\ \;\;\;\;\frac{x}{\frac{y}{\sin y} \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;x \le -1.2889274271188022 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\

\mathbf{elif}\;x \le 1.5442293158046647 \cdot 10^{+242}:\\
\;\;\;\;\frac{x}{\frac{y}{\sin y} \cdot z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r34250689 = x;
        double r34250690 = y;
        double r34250691 = sin(r34250690);
        double r34250692 = r34250691 / r34250690;
        double r34250693 = r34250689 * r34250692;
        double r34250694 = z;
        double r34250695 = r34250693 / r34250694;
        return r34250695;
}

double f(double x, double y, double z) {
        double r34250696 = x;
        double r34250697 = -1.2889274271188022e+17;
        bool r34250698 = r34250696 <= r34250697;
        double r34250699 = y;
        double r34250700 = sin(r34250699);
        double r34250701 = r34250700 * r34250696;
        double r34250702 = r34250701 / r34250699;
        double r34250703 = z;
        double r34250704 = r34250702 / r34250703;
        double r34250705 = 1.5442293158046647e+242;
        bool r34250706 = r34250696 <= r34250705;
        double r34250707 = r34250699 / r34250700;
        double r34250708 = r34250707 * r34250703;
        double r34250709 = r34250696 / r34250708;
        double r34250710 = r34250706 ? r34250709 : r34250704;
        double r34250711 = r34250698 ? r34250704 : r34250710;
        return r34250711;
}

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.2
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;z \lt -4.2173720203427147 \cdot 10^{-29}:\\ \;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\ \mathbf{elif}\;z \lt 4.446702369113811 \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.2889274271188022e+17 or 1.5442293158046647e+242 < x

    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.3

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

    if -1.2889274271188022e+17 < x < 1.5442293158046647e+242

    1. Initial program 3.6

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}}}{z}\]
    4. Applied un-div-inv3.6

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{\sin y}}}}{z}\]
    5. Applied associate-/l/1.2

      \[\leadsto \color{blue}{\frac{x}{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.2889274271188022 \cdot 10^{+17}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \mathbf{elif}\;x \le 1.5442293158046647 \cdot 10^{+242}:\\ \;\;\;\;\frac{x}{\frac{y}{\sin y} \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\ \end{array}\]

Reproduce

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

  :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))