Average Error: 10.6 → 1.6
Time: 10.3s
Precision: binary64
Cost: 832
\[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
\[x + y \cdot \frac{1}{\frac{a - t}{z - t}} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (+ x (* y (/ 1.0 (/ (- a t) (- z t))))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
	return x + (y * (1.0 / ((a - t) / (z - t))));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((y * (z - t)) / (a - t))
end function
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * (1.0d0 / ((a - t) / (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (a - t));
}
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * (1.0 / ((a - t) / (z - t))));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (a - t))
def code(x, y, z, t, a):
	return x + (y * (1.0 / ((a - t) / (z - t))))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t)))
end
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(1.0 / Float64(Float64(a - t) / Float64(z - t)))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (a - t));
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * (1.0 / ((a - t) / (z - t))));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(1.0 / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{1}{\frac{a - t}{z - t}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.6
Target1.4
Herbie1.6
\[x + \frac{y}{\frac{a - t}{z - t}} \]

Derivation

  1. Initial program 10.6

    \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
  2. Applied egg-rr1.6

    \[\leadsto x + \color{blue}{y \cdot \frac{1}{\frac{a - t}{z - t}}} \]
  3. Final simplification1.6

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

Alternatives

Alternative 1
Error2.5
Cost1992
\[\begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+295}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\ \end{array} \]
Alternative 2
Error10.9
Cost840
\[\begin{array}{l} t_1 := x - \frac{y}{\frac{a - t}{t}}\\ \mathbf{if}\;t \leq -4.071511416001858 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8.838753382168689 \cdot 10^{-153}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error8.5
Cost840
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a - t}{z}}\\ \mathbf{if}\;z \leq -1.8806392455483117 \cdot 10^{+44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.417193312800827 \cdot 10^{+109}:\\ \;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error19.2
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -2.2809849630464558 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.283819516414495 \cdot 10^{-61}:\\ \;\;\;\;x - y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 5
Error19.1
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -2.2809849630464558 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.283819516414495 \cdot 10^{-61}:\\ \;\;\;\;x - \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error14.2
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -2.2809849630464558 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.283819516414495 \cdot 10^{-61}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error14.4
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -2.2809849630464558 \cdot 10^{+53}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.283819516414495 \cdot 10^{-61}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error19.5
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -1.985141535833203 \cdot 10^{-93}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.462849520098056 \cdot 10^{-65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 9
Error28.5
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022317 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

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

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