Average Error: 2.9 → 0.2
Time: 15.7s
Precision: 64
\[\frac{x \cdot \frac{\sin y}{y}}{z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \cdot x \le -1.410296865848041 \cdot 10^{-304}:\\ \;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\ \mathbf{elif}\;\frac{\sin y}{y} \cdot x \le 0.0:\\ \;\;\;\;\frac{\frac{\sin y}{y}}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\ \end{array}\]
\frac{x \cdot \frac{\sin y}{y}}{z}
\begin{array}{l}
\mathbf{if}\;\frac{\sin y}{y} \cdot x \le -1.410296865848041 \cdot 10^{-304}:\\
\;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\

\mathbf{elif}\;\frac{\sin y}{y} \cdot x \le 0.0:\\
\;\;\;\;\frac{\frac{\sin y}{y}}{z} \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r21108633 = x;
        double r21108634 = y;
        double r21108635 = sin(r21108634);
        double r21108636 = r21108635 / r21108634;
        double r21108637 = r21108633 * r21108636;
        double r21108638 = z;
        double r21108639 = r21108637 / r21108638;
        return r21108639;
}

double f(double x, double y, double z) {
        double r21108640 = y;
        double r21108641 = sin(r21108640);
        double r21108642 = r21108641 / r21108640;
        double r21108643 = x;
        double r21108644 = r21108642 * r21108643;
        double r21108645 = -1.410296865848041e-304;
        bool r21108646 = r21108644 <= r21108645;
        double r21108647 = z;
        double r21108648 = r21108644 / r21108647;
        double r21108649 = 0.0;
        bool r21108650 = r21108644 <= r21108649;
        double r21108651 = r21108642 / r21108647;
        double r21108652 = r21108651 * r21108643;
        double r21108653 = r21108650 ? r21108652 : r21108648;
        double r21108654 = r21108646 ? r21108648 : r21108653;
        return r21108654;
}

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.9
Target0.3
Herbie0.2
\[\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 (/ (sin y) y)) < -1.410296865848041e-304 or 0.0 < (* x (/ (sin y) y))

    1. Initial program 0.2

      \[\frac{x \cdot \frac{\sin y}{y}}{z}\]

    if -1.410296865848041e-304 < (* x (/ (sin y) y)) < 0.0

    1. Initial program 19.2

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

      \[\leadsto \frac{x \cdot \frac{\sin y}{y}}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac0.1

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

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

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

Reproduce

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