Average Error: 35.7 → 27.8
Time: 11.3s
Precision: binary64
\[\]
\[\]
double code(double x, double y) {
	return ((double) (((double) tan(((double) (x / ((double) (y * 2.0)))))) / ((double) sin(((double) (x / ((double) (y * 2.0))))))));
}
double code(double x, double y) {
	double VAR;
	if ((((double) (x / ((double) (y * 2.0)))) <= 6.1874965967347206e-105)) {
		VAR = 1.0;
	} else {
		double VAR_1;
		if ((((double) (x / ((double) (y * 2.0)))) <= 1.440401153868107e+300)) {
			VAR_1 = ((double) (((double) (((double) cbrt(((double) (((double) tan(((double) (x / ((double) (y * 2.0)))))) / ((double) sin(((double) (x / ((double) (y * 2.0)))))))))) * ((double) cbrt(((double) (((double) tan(((double) (x / ((double) (y * 2.0)))))) / ((double) sin(((double) (x / ((double) (y * 2.0)))))))))))) * ((double) cbrt(((double) (((double) tan(((double) (x / ((double) (y * 2.0)))))) / ((double) cbrt(((double) pow(((double) sin(((double) (x / ((double) (y * 2.0)))))), 3.0))))))))));
		} else {
			VAR_1 = 1.0;
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original35.7
Target28.7
Herbie27.8
\[\]

Derivation

  1. Split input into 2 regimes
  2. if (/ x (* y 2.0)) < 6.18749659673472057e-105 or 1.44040115386810715e300 < (/ x (* y 2.0))

    1. Initial program 34.6

      \[\]
    2. Taylor expanded around 0 24.0

      \[\leadsto \]

    if 6.18749659673472057e-105 < (/ x (* y 2.0)) < 1.44040115386810715e300

    1. Initial program 38.7

      \[\]
    2. Using strategy rm
    3. Applied add-cube-cbrt38.7

      \[\leadsto \]
    4. Using strategy rm
    5. Applied add-cbrt-cube38.7

      \[\leadsto \]
    6. Simplified38.7

      \[\leadsto \]
  3. Recombined 2 regimes into one program.
  4. Final simplification27.8

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y)
  :name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
  :precision binary64

  :herbie-target
  (if (< y -1.2303690911306994e+114) 1.0 (if (< y -9.102852406811914e-222) (/ (sin (/ x (* y 2.0))) (* (sin (/ x (* y 2.0))) (log (exp (cos (/ x (* y 2.0))))))) 1.0))

  (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))