Average Error: 7.7 → 1.0
Time: 10.3min
Precision: binary64
\[\frac{\cosh x \cdot \frac{y}{x}}{z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.80235168650595605 \cdot 10^{131} \lor \neg \left(z \le 1.78878524148666301 \cdot 10^{38}\right):\\ \;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cosh x}{z \cdot \frac{x}{y}}\\ \end{array}\]
\frac{\cosh x \cdot \frac{y}{x}}{z}
\begin{array}{l}
\mathbf{if}\;z \le -5.80235168650595605 \cdot 10^{131} \lor \neg \left(z \le 1.78878524148666301 \cdot 10^{38}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\

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

\end{array}
double code(double x, double y, double z) {
	return (((double) (((double) cosh(x)) * (y / x))) / z);
}
double code(double x, double y, double z) {
	double VAR;
	if (((z <= -5.802351686505956e+131) || !(z <= 1.788785241486663e+38))) {
		VAR = (((double) (((double) cosh(x)) * y)) / ((double) (z * x)));
	} else {
		VAR = (((double) cosh(x)) / ((double) (z * (x / y))));
	}
	return VAR;
}

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

Original7.7
Target0.5
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;y \lt -4.618902267687042 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{y}{z}}{x} \cdot \cosh x\\ \mathbf{elif}\;y \lt 1.0385305359351529 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{z}}{x} \cdot \cosh x\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -5.80235168650595605e131 or 1.78878524148666301e38 < z

    1. Initial program 14.1

      \[\frac{\cosh x \cdot \frac{y}{x}}{z}\]
    2. Using strategy rm
    3. Applied associate-*r/14.1

      \[\leadsto \frac{\color{blue}{\frac{\cosh x \cdot y}{x}}}{z}\]
    4. Applied associate-/l/0.3

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

    if -5.80235168650595605e131 < z < 1.78878524148666301e38

    1. Initial program 1.7

      \[\frac{\cosh x \cdot \frac{y}{x}}{z}\]
    2. Using strategy rm
    3. Applied associate-*r/1.7

      \[\leadsto \frac{\color{blue}{\frac{\cosh x \cdot y}{x}}}{z}\]
    4. Applied associate-/l/13.9

      \[\leadsto \color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\]
    5. Using strategy rm
    6. Applied associate-/l*14.0

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z \cdot x}{y}}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity14.0

      \[\leadsto \frac{\cosh x}{\frac{z \cdot x}{\color{blue}{1 \cdot y}}}\]
    9. Applied times-frac1.6

      \[\leadsto \frac{\cosh x}{\color{blue}{\frac{z}{1} \cdot \frac{x}{y}}}\]
    10. Simplified1.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.80235168650595605 \cdot 10^{131} \lor \neg \left(z \le 1.78878524148666301 \cdot 10^{38}\right):\\ \;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cosh x}{z \cdot \frac{x}{y}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))

  (/ (* (cosh x) (/ y x)) z))