Average Error: 11.2 → 1.4
Time: 21.0s
Precision: binary64
Cost: 1088
\[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
\[x + \left(\frac{z}{a - t} \cdot y + \frac{t}{t - a} \cdot y\right) \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (+ x (+ (* (/ z (- a t)) y) (* (/ t (- t a)) y))))
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 + (((z / (a - t)) * y) + ((t / (t - a)) * y));
}
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 + (((z / (a - t)) * y) + ((t / (t - a)) * y))
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 + (((z / (a - t)) * y) + ((t / (t - a)) * y));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (a - t))
def code(x, y, z, t, a):
	return x + (((z / (a - t)) * y) + ((t / (t - a)) * y))
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(Float64(Float64(z / Float64(a - t)) * y) + Float64(Float64(t / Float64(t - a)) * y)))
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 + (((z / (a - t)) * y) + ((t / (t - a)) * y));
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[(N[(N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + N[(N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + \left(\frac{z}{a - t} \cdot y + \frac{t}{t - a} \cdot y\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.2
Target1.3
Herbie1.4
\[x + \frac{y}{\frac{a - t}{z - t}} \]

Derivation

  1. Initial program 11.2

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

    \[\leadsto x + \color{blue}{\frac{z - t}{a - t} \cdot y} \]
  3. Applied egg-rr1.4

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

Alternatives

Alternative 1
Error13.5
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -2.55 \cdot 10^{-42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-110}:\\ \;\;\;\;\frac{y \cdot z}{a} + x\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{t - a}\\ \end{array} \]
Alternative 2
Error13.4
Cost840
\[\begin{array}{l} t_1 := x + \left(t - z\right) \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -3.4 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{y \cdot z}{a} + x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error10.8
Cost840
\[\begin{array}{l} t_1 := x + \left(t - z\right) \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -1220000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+58}:\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error9.6
Cost840
\[\begin{array}{l} t_1 := \left(1 - \frac{z}{t}\right) \cdot y + x\\ \mathbf{if}\;t \leq -29000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{+61}:\\ \;\;\;\;x + \frac{y \cdot z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error14.1
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{-40}:\\ \;\;\;\;x + \frac{y}{a} \cdot z\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 6
Error14.9
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -5.9 \cdot 10^{-43}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-48}:\\ \;\;\;\;\frac{y \cdot z}{a} + x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 7
Error2.9
Cost704
\[x + \frac{y}{a - t} \cdot \left(z - t\right) \]
Alternative 8
Error1.4
Cost704
\[x + \frac{z - t}{a - t} \cdot y \]
Alternative 9
Error20.2
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+14}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-167}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 10
Error28.5
Cost64
\[x \]

Error

Reproduce

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