?

Average Error: 10.9 → 1.2
Time: 9.0s
Precision: binary64
Cost: 704

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation?

  1. Initial program 10.9

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

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

    [Start]10.9

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

    associate-/l* [=>]1.2

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

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

Alternatives

Alternative 1
Error17.1
Cost976
\[\begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{-157}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-64}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+33}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{+98}:\\ \;\;\;\;x - \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 2
Error10.8
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+75}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+89}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 3
Error15.1
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-122}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 4
Error3.2
Cost704
\[x + \left(z - t\right) \cdot \frac{y}{a - t} \]
Alternative 5
Error20.0
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-20}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error27.4
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-197}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-64}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 7
Error28.9
Cost64
\[x \]

Error

Reproduce?

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