Average Error: 7.4 → 0.4
Time: 3.5s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z) {
	return ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((double) (((double) cosh(x)) * ((double) (y / x)))) <= -1.9726858183719933e+160)) {
		VAR = ((double) (((double) (((double) cosh(x)) * ((double) (y / z)))) / x));
	} else {
		double VAR_1;
		if ((((double) (((double) cosh(x)) * ((double) (y / x)))) <= 6.326437943592754e+264)) {
			VAR_1 = ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
		} else {
			VAR_1 = ((double) (1.0 / ((double) (x * ((double) (z / ((double) (((double) cosh(x)) * y))))))));
		}
		VAR = VAR_1;
	}
	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.4
Target0.4
Herbie0.4
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (* (cosh x) (/ y x)) < -1.9726858183719933e160

    1. Initial program 22.3

      \[\]
    2. Using strategy rm
    3. Applied div-inv22.4

      \[\leadsto \]
    4. Using strategy rm
    5. Applied associate-*r/22.4

      \[\leadsto \]
    6. Applied associate-*l/1.2

      \[\leadsto \]
    7. Simplified1.1

      \[\leadsto \]

    if -1.9726858183719933e160 < (* (cosh x) (/ y x)) < 6.3264379435927536e264

    1. Initial program 0.3

      \[\]

    if 6.3264379435927536e264 < (* (cosh x) (/ y x))

    1. Initial program 44.8

      \[\]
    2. Using strategy rm
    3. Applied clear-num44.8

      \[\leadsto \]
    4. Simplified0.6

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \]

Reproduce

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