Average Error: 11.5 → 2.1
Time: 9.1s
Precision: binary64
Cost: 576
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[\frac{x}{\frac{t - z}{y - z}} \]
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
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)) / (t - z)
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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
public static double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
def code(x, y, z, t):
	return x / ((t - z) / (y - z))
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function code(x, y, z, t)
	return Float64(x / Float64(Float64(t - z) / Float64(y - z)))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
function tmp = code(x, y, z, t)
	tmp = x / ((t - z) / (y - z));
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\frac{t - z}{y - z}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.5
Target2.1
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}} \]

Derivation

  1. Initial program 11.5

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Simplified2.1

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

    [Start]11.5

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

    associate-/l* [=>]2.1

    \[ \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
  3. Final simplification2.1

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

Alternatives

Alternative 1
Error20.6
Cost977
\[\begin{array}{l} t_1 := y \cdot \frac{x}{t - z}\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+116}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-26} \lor \neg \left(y \leq 2.2 \cdot 10^{+55}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
Alternative 2
Error26.1
Cost848
\[\begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-68}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+30}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 3
Error26.1
Cost848
\[\begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \frac{-y}{z}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-67}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+34}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Error26.1
Cost848
\[\begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{+38}:\\ \;\;\;\;\frac{-x}{\frac{z}{y}}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-68}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+30}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 5
Error18.7
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{-115} \lor \neg \left(z \leq 1.4 \cdot 10^{-102}\right):\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \end{array} \]
Alternative 6
Error16.8
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-26} \lor \neg \left(y \leq 4.3 \cdot 10^{+55}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
Alternative 7
Error37.4
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-72}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-165}:\\ \;\;\;\;z \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 8
Error25.0
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-68}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 9
Error25.0
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-68}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+30}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 10
Error25.7
Cost584
\[\begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{-67}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+30}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error2.1
Cost576
\[x \cdot \frac{z - y}{z - t} \]
Alternative 12
Error39.7
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2023016 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

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

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