Average Error: 10.2 → 10.2
Time: 7.0s
Precision: binary64
\[\frac{x - y \cdot z}{t - a \cdot z}\]
\[\frac{x - y \cdot z}{t - a \cdot z}\]
\frac{x - y \cdot z}{t - a \cdot z}
\frac{x - y \cdot z}{t - a \cdot z}
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) (y * z)))) / ((double) (t - ((double) (a * z))))));
}

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.2
Target1.7
Herbie10.2
\[\begin{array}{l} \mathbf{if}\;z \lt -32113435955957344:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \mathbf{elif}\;z \lt 3.51395223729782958 \cdot 10^{-86}:\\ \;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t - a \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - a \cdot z} - \frac{y}{\frac{t}{z} - a}\\ \end{array}\]

Derivation

  1. Initial program 10.2

    \[\frac{x - y \cdot z}{t - a \cdot z}\]
  2. Final simplification10.2

    \[\leadsto \frac{x - y \cdot z}{t - a \cdot z}\]

Reproduce

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