?

Average Error: 3.58% → 3.58%
Time: 8.6s
Precision: binary64
Cost: 576

?

\[\frac{x - y}{z - y} \cdot t \]
\[\frac{x - y}{z - y} \cdot t \]
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\frac{x - y}{z - y} \cdot t
\frac{x - y}{z - y} \cdot t

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.58%
Target3.51%
Herbie3.58%
\[\frac{t}{\frac{z - y}{x - y}} \]

Derivation?

  1. Initial program 3.58

    \[\frac{x - y}{z - y} \cdot t \]
  2. Final simplification3.58

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

Alternatives

Alternative 1
Error33.66%
Cost976
\[\begin{array}{l} t_1 := y \cdot \frac{t}{y - z}\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{+191}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+200}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 2
Error26.66%
Cost976
\[\begin{array}{l} \mathbf{if}\;y \leq -82000000:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-66}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-179}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 1300000000:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 3
Error26.63%
Cost976
\[\begin{array}{l} \mathbf{if}\;y \leq -80000000:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{-64}:\\ \;\;\;\;\frac{-y}{\frac{z - y}{t}}\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-178}:\\ \;\;\;\;\frac{x \cdot t}{z - y}\\ \mathbf{elif}\;y \leq 4400000000:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 4
Error31.73%
Cost844
\[\begin{array}{l} t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -3000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.9 \cdot 10^{-67}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq 18500000000:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error30.82%
Cost844
\[\begin{array}{l} \mathbf{if}\;y \leq -62000000:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -2.75 \cdot 10^{-66}:\\ \;\;\;\;y \cdot \frac{t}{y - z}\\ \mathbf{elif}\;y \leq 5000000000:\\ \;\;\;\;\frac{t}{\frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 6
Error10.54%
Cost840
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+187}:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+132}:\\ \;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 7
Error26.44%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -4500000:\\ \;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 2900000000:\\ \;\;\;\;\frac{t}{\frac{z}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{y - z}\\ \end{array} \]
Alternative 8
Error57.94%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-41}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-57}:\\ \;\;\;\;y \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 9
Error39.74%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{-16}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 28000000000:\\ \;\;\;\;x \cdot \frac{t}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 10
Error38.86%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-14}:\\ \;\;\;\;t\\ \mathbf{elif}\;y \leq 2450000000000:\\ \;\;\;\;t \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 11
Error61.68%
Cost64
\[t \]

Error

Reproduce?

herbie shell --seed 2023121 
(FPCore (x y z t)
  :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
  :precision binary64

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

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