Average Error: 7.9 → 0.4
Time: 3.8s
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) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= -inf.0)) {
		VAR = ((double) (y * ((double) (((double) cosh(x)) / ((double) (x * z))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= 5.75167906107457e-57)) {
			VAR_1 = ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
		} else {
			VAR_1 = ((double) (((double) cosh(x)) / ((double) (x * ((double) (z / 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.9
Target0.4
Herbie0.4
\[\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* (cosh x) (/ y x)) z) < -inf.0

    1. Initial program 64.0

      \[\]
    2. Using strategy rm
    3. Applied associate-/l*63.9

      \[\leadsto \]
    4. Simplified0.5

      \[\leadsto \]
    5. Using strategy rm
    6. Applied associate-*r/0.5

      \[\leadsto \]
    7. Applied associate-/r/0.5

      \[\leadsto \]

    if -inf.0 < (/ (* (cosh x) (/ y x)) z) < 5.75167906107457026e-57

    1. Initial program 0.2

      \[\]

    if 5.75167906107457026e-57 < (/ (* (cosh x) (/ y x)) z)

    1. Initial program 11.3

      \[\]
    2. Using strategy rm
    3. Applied associate-/l*11.4

      \[\leadsto \]
    4. Simplified0.8

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

    \[\leadsto \]

Reproduce

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