Average Error: 3.6 → 0.4
Time: 4.0s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((t <= -4.4921344350055706e+17) || !(t <= 4.133835692596042e-32))) {
		VAR = ((double) (((double) (x - ((double) (((double) (y / z)) / 3.0)))) + ((double) (t / ((double) (y * ((double) (z * 3.0))))))));
	} else {
		VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (((double) (1.0 / ((double) (z * 3.0)))) * ((double) (t / y))))));
	}
	return VAR;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.6
Target1.8
Herbie0.4
\[\]

Derivation

  1. Split input into 2 regimes
  2. if t < -449213443500557060 or 4.13383569259604196e-32 < t

    1. Initial program 0.6

      \[\]
    2. Using strategy rm
    3. Applied associate-/r*0.7

      \[\leadsto \]

    if -449213443500557060 < t < 4.13383569259604196e-32

    1. Initial program 5.9

      \[\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.9

      \[\leadsto \]
    4. Applied times-frac0.2

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

    \[\leadsto \]

Reproduce

herbie shell --seed 2020190 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :herbie-target
  (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))