Average Error: 10.4 → 2.9
Time: 5.2s
Precision: binary64
\[\]
\[\]
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (x - ((double) (y * z)))) / ((double) (t - ((double) (a * z))))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) (((double) (x / ((double) (t - ((double) (z * a)))))) - ((double) (y / ((double) (((double) (t / z)) - a))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.4
Target1.8
Herbie2.9
\[\]

Derivation

  1. Initial program 10.4

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

    \[\leadsto \]
  4. Simplified10.4

    \[\leadsto \]
  5. Simplified2.9

    \[\leadsto \]
  6. Final simplification2.9

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))

  (/ (- x (* y z)) (- t (* a z))))