Average Error: 3.5 → 0.8
Time: 3.8s
Precision: 64
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;z \cdot 3 \le -4.8789212851081629 \cdot 10^{97}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot 3} \cdot \frac{1}{y}\\ \mathbf{elif}\;z \cdot 3 \le 9.9293498959749377 \cdot 10^{-50}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{y}}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\left(z \cdot 3\right) \cdot y}{t}}\\ \end{array}\]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \le -4.8789212851081629 \cdot 10^{97}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot 3} \cdot \frac{1}{y}\\

\mathbf{elif}\;z \cdot 3 \le 9.9293498959749377 \cdot 10^{-50}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{y}}{z \cdot 3}\\

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if (((z * 3.0) <= -4.878921285108163e+97)) {
		VAR = ((x - (y / (z * 3.0))) + ((t / (z * 3.0)) * (1.0 / y)));
	} else {
		double VAR_1;
		if (((z * 3.0) <= 9.929349895974938e-50)) {
			VAR_1 = ((x - (y / (z * 3.0))) + ((t / y) / (z * 3.0)));
		} else {
			VAR_1 = ((x - (y / (z * 3.0))) + (1.0 / (((z * 3.0) * y) / t)));
		}
		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.5
Target1.7
Herbie0.8
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]

Derivation

  1. Split input into 3 regimes
  2. if (* z 3.0) < -4.878921285108163e+97

    1. Initial program 0.5

      \[\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*1.2

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\frac{t}{z \cdot 3}}{y}}\]
    4. Using strategy rm
    5. Applied div-inv1.2

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

    if -4.878921285108163e+97 < (* z 3.0) < 9.929349895974938e-50

    1. Initial program 8.4

      \[\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*2.7

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\frac{t}{z \cdot 3}}{y}}\]
    4. Using strategy rm
    5. Applied div-inv2.7

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{z \cdot 3} \cdot \frac{1}{y}}\]
    6. Using strategy rm
    7. Applied associate-*l/1.0

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

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

    if 9.929349895974938e-50 < (* z 3.0)

    1. Initial program 0.5

      \[\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.5

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

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

Reproduce

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

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

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