?

Average Error: 10.7 → 1.4
Time: 14.4s
Precision: binary64
Cost: 704

?

\[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
\[x + y \cdot \frac{z - t}{a - 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 (/ (- z t) (- a 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 * ((z - t) / (a - 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 * ((z - t) / (a - 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 * ((z - t) / (a - 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 * ((z - t) / (a - 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(Float64(z - t) / Float64(a - 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 * ((z - t) / (a - 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[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + y \cdot \frac{z - t}{a - t}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 10.7

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

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

    [Start]10.7

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

    rational_best-simplify-2 [=>]10.7

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

    rational_best-simplify-47 [=>]1.4

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

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

Alternatives

Alternative 1
Error21.1
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -27500:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 2
Error21.1
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -61000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 3.65 \cdot 10^{-122}:\\ \;\;\;\;\frac{y}{a} \cdot \left(z - t\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 3
Error11.2
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -11200000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 4
Error8.7
Cost840
\[\begin{array}{l} t_1 := x + y \cdot \frac{t - z}{t}\\ \mathbf{if}\;t \leq -800000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 0.000105:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error14.2
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -39000000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-8}:\\ \;\;\;\;y \cdot \frac{z}{a} + x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 6
Error20.1
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -1360000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 10^{-101}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 7
Error27.3
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -1.96 \cdot 10^{+108}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+79}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 8
Error28.9
Cost64
\[x \]

Error

Reproduce?

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