Average Error: 3.7 → 0.6
Time: 4.4s
Precision: binary64
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.1603011515056161 \cdot 10^{63}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\left(y \cdot z\right) \cdot \frac{3}{t}}\\ \mathbf{elif}\;t \le 5.9811512974853166 \cdot 10^{88}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \end{array}\]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;t \le -1.1603011515056161 \cdot 10^{63}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\left(y \cdot z\right) \cdot \frac{3}{t}}\\

\mathbf{elif}\;t \le 5.9811512974853166 \cdot 10^{88}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\

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

\end{array}
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 <= -1.1603011515056161e+63)) {
		VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (1.0 / ((double) (((double) (y * z)) * ((double) (3.0 / t))))))));
	} else {
		double VAR_1;
		if ((t <= 5.9811512974853166e+88)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (t / y)) - y)) / ((double) (z * 3.0))))));
		} else {
			VAR_1 = ((double) (((double) (x - ((double) (((double) (y / z)) / 3.0)))) + ((double) (t / ((double) (y * ((double) (z * 3.0))))))));
		}
		VAR = VAR_1;
	}
	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.7
Target1.9
Herbie0.6
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.1603011515056161e63

    1. Initial program 0.6

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied clear-num0.6

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

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

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

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

    if -1.1603011515056161e63 < t < 5.9811512974853166e88

    1. Initial program 5.1

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Simplified0.6

      \[\leadsto \color{blue}{x + \frac{\frac{t}{y} - y}{z \cdot 3}}\]

    if 5.9811512974853166e88 < t

    1. Initial program 0.6

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied associate-/r*0.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.1603011515056161 \cdot 10^{63}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\left(y \cdot z\right) \cdot \frac{3}{t}}\\ \mathbf{elif}\;t \le 5.9811512974853166 \cdot 10^{88}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \end{array}\]

Reproduce

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