Average Error: 7.2 → 0.6
Time: 3.3s
Precision: binary64
\[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.369313210638426204:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{1}{t \cdot \frac{z}{x} + -1}\right)}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{x + 1}} \cdot \frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{z \cdot t - x}\right)}{\sqrt{x + 1}}\\ \end{array}\]
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\begin{array}{l}
\mathbf{if}\;x \le -0.369313210638426204:\\
\;\;\;\;\frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{1}{t \cdot \frac{z}{x} + -1}\right)}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1}} \cdot \frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{z \cdot t - x}\right)}{\sqrt{x + 1}}\\

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x + ((double) (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x)))))) / ((double) (x + 1.0))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((x <= -0.3693132106384262)) {
		VAR = ((double) (((double) (x + ((double) (((double) (y * ((double) (z / ((double) (((double) (z * t)) - x)))))) - ((double) (1.0 / ((double) (((double) (t * ((double) (z / x)))) + -1.0)))))))) / ((double) (x + 1.0))));
	} else {
		VAR = ((double) (((double) (1.0 / ((double) sqrt(((double) (x + 1.0)))))) * ((double) (((double) (x + ((double) (((double) (y / ((double) (t - ((double) (x / z)))))) - ((double) (x / ((double) (((double) (z * t)) - x)))))))) / ((double) sqrt(((double) (x + 1.0))))))));
	}
	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

Original7.2
Target0.4
Herbie0.6
\[\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -0.369313210638426204

    1. Initial program 7.4

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
    2. Using strategy rm
    3. Applied div-sub7.4

      \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{t \cdot z - x} - \frac{x}{t \cdot z - x}\right)}}{x + 1}\]
    4. Simplified1.0

      \[\leadsto \frac{x + \left(\color{blue}{y \cdot \frac{z}{z \cdot t - x}} - \frac{x}{t \cdot z - x}\right)}{x + 1}\]
    5. Simplified1.0

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \color{blue}{\frac{x}{z \cdot t - x}}\right)}{x + 1}\]
    6. Using strategy rm
    7. Applied clear-num1.0

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \color{blue}{\frac{1}{\frac{z \cdot t - x}{x}}}\right)}{x + 1}\]
    8. Simplified1.0

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{1}{\color{blue}{\frac{z}{x} \cdot t + -1}}\right)}{x + 1}\]

    if -0.369313210638426204 < x

    1. Initial program 7.1

      \[\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\]
    2. Using strategy rm
    3. Applied div-sub7.1

      \[\leadsto \frac{x + \color{blue}{\left(\frac{y \cdot z}{t \cdot z - x} - \frac{x}{t \cdot z - x}\right)}}{x + 1}\]
    4. Simplified2.8

      \[\leadsto \frac{x + \left(\color{blue}{y \cdot \frac{z}{z \cdot t - x}} - \frac{x}{t \cdot z - x}\right)}{x + 1}\]
    5. Simplified2.8

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \color{blue}{\frac{x}{z \cdot t - x}}\right)}{x + 1}\]
    6. Using strategy rm
    7. Applied add-sqr-sqrt3.0

      \[\leadsto \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}\]
    8. Applied *-un-lft-identity3.0

      \[\leadsto \frac{\color{blue}{1 \cdot \left(x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)\right)}}{\sqrt{x + 1} \cdot \sqrt{x + 1}}\]
    9. Applied times-frac3.0

      \[\leadsto \color{blue}{\frac{1}{\sqrt{x + 1}} \cdot \frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{x}{z \cdot t - x}\right)}{\sqrt{x + 1}}}\]
    10. Simplified0.5

      \[\leadsto \frac{1}{\sqrt{x + 1}} \cdot \color{blue}{\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{z \cdot t - x}\right)}{\sqrt{x + 1}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.369313210638426204:\\ \;\;\;\;\frac{x + \left(y \cdot \frac{z}{z \cdot t - x} - \frac{1}{t \cdot \frac{z}{x} + -1}\right)}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{x + 1}} \cdot \frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{z \cdot t - x}\right)}{\sqrt{x + 1}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020179 
(FPCore (x y z t)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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