
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * 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 * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * 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 * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x t) (- 0.0 z))))
(if (<= (* z t) -1e+301)
t_1
(if (<= (* z t) 1e+158) (/ x (- y (* z t))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / (0.0 - z);
double tmp;
if ((z * t) <= -1e+301) {
tmp = t_1;
} else if ((z * t) <= 1e+158) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: t_1
real(8) :: tmp
t_1 = (x / t) / (0.0d0 - z)
if ((z * t) <= (-1d+301)) then
tmp = t_1
else if ((z * t) <= 1d+158) then
tmp = x / (y - (z * t))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / t) / (0.0 - z);
double tmp;
if ((z * t) <= -1e+301) {
tmp = t_1;
} else if ((z * t) <= 1e+158) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / t) / (0.0 - z) tmp = 0 if (z * t) <= -1e+301: tmp = t_1 elif (z * t) <= 1e+158: tmp = x / (y - (z * t)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / Float64(0.0 - z)) tmp = 0.0 if (Float64(z * t) <= -1e+301) tmp = t_1; elseif (Float64(z * t) <= 1e+158) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / (0.0 - z);
tmp = 0.0;
if ((z * t) <= -1e+301)
tmp = t_1;
elseif ((z * t) <= 1e+158)
tmp = x / (y - (z * t));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / N[(0.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+301], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+158], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{0 - z}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+158}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.00000000000000005e301 or 9.99999999999999953e157 < (*.f64 z t) Initial program 83.5%
clear-numN/A
associate-/r/N/A
flip--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6483.6%
Applied egg-rr83.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f6483.6%
Simplified83.6%
associate-*l/N/A
neg-mul-1N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
sub0-negN/A
neg-lowering-neg.f6499.8%
Applied egg-rr99.8%
if -1.00000000000000005e301 < (*.f64 z t) < 9.99999999999999953e157Initial program 99.8%
Final simplification99.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= (* z t) -1e-86) (/ (- 0.0 (/ x z)) t) (if (<= (* z t) 2e-12) (/ x y) (/ (/ x t) (- 0.0 z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e-86) {
tmp = (0.0 - (x / z)) / t;
} else if ((z * t) <= 2e-12) {
tmp = x / y;
} else {
tmp = (x / t) / (0.0 - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: tmp
if ((z * t) <= (-1d-86)) then
tmp = (0.0d0 - (x / z)) / t
else if ((z * t) <= 2d-12) then
tmp = x / y
else
tmp = (x / t) / (0.0d0 - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -1e-86) {
tmp = (0.0 - (x / z)) / t;
} else if ((z * t) <= 2e-12) {
tmp = x / y;
} else {
tmp = (x / t) / (0.0 - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z * t) <= -1e-86: tmp = (0.0 - (x / z)) / t elif (z * t) <= 2e-12: tmp = x / y else: tmp = (x / t) / (0.0 - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= -1e-86) tmp = Float64(Float64(0.0 - Float64(x / z)) / t); elseif (Float64(z * t) <= 2e-12) tmp = Float64(x / y); else tmp = Float64(Float64(x / t) / Float64(0.0 - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z * t) <= -1e-86)
tmp = (0.0 - (x / z)) / t;
elseif ((z * t) <= 2e-12)
tmp = x / y;
else
tmp = (x / t) / (0.0 - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e-86], N[(N[(0.0 - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e-12], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(0.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-86}:\\
\;\;\;\;\frac{0 - \frac{x}{z}}{t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{0 - z}\\
\end{array}
\end{array}
if (*.f64 z t) < -1.00000000000000008e-86Initial program 94.0%
clear-numN/A
associate-/r/N/A
flip--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6494.0%
Applied egg-rr94.0%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f6472.1%
Simplified72.1%
*-commutativeN/A
associate-*l/N/A
neg-mul-1N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6474.4%
Applied egg-rr74.4%
sub0-negN/A
neg-lowering-neg.f6474.4%
Applied egg-rr74.4%
if -1.00000000000000008e-86 < (*.f64 z t) < 1.99999999999999996e-12Initial program 99.9%
Taylor expanded in y around inf
/-lowering-/.f6484.9%
Simplified84.9%
if 1.99999999999999996e-12 < (*.f64 z t) Initial program 92.4%
clear-numN/A
associate-/r/N/A
flip--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6492.5%
Applied egg-rr92.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f6480.7%
Simplified80.7%
associate-*l/N/A
neg-mul-1N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6485.2%
Applied egg-rr85.2%
sub0-negN/A
neg-lowering-neg.f6485.2%
Applied egg-rr85.2%
Final simplification81.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (/ x t) (- 0.0 z)))) (if (<= (* z t) -1e-9) t_1 (if (<= (* z t) 2e-12) (/ x y) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / t) / (0.0 - z);
double tmp;
if ((z * t) <= -1e-9) {
tmp = t_1;
} else if ((z * t) <= 2e-12) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: t_1
real(8) :: tmp
t_1 = (x / t) / (0.0d0 - z)
if ((z * t) <= (-1d-9)) then
tmp = t_1
else if ((z * t) <= 2d-12) then
tmp = x / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / t) / (0.0 - z);
double tmp;
if ((z * t) <= -1e-9) {
tmp = t_1;
} else if ((z * t) <= 2e-12) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / t) / (0.0 - z) tmp = 0 if (z * t) <= -1e-9: tmp = t_1 elif (z * t) <= 2e-12: tmp = x / y else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / t) / Float64(0.0 - z)) tmp = 0.0 if (Float64(z * t) <= -1e-9) tmp = t_1; elseif (Float64(z * t) <= 2e-12) tmp = Float64(x / y); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / t) / (0.0 - z);
tmp = 0.0;
if ((z * t) <= -1e-9)
tmp = t_1;
elseif ((z * t) <= 2e-12)
tmp = x / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / N[(0.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e-9], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e-12], N[(x / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{0 - z}\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.00000000000000006e-9 or 1.99999999999999996e-12 < (*.f64 z t) Initial program 92.8%
clear-numN/A
associate-/r/N/A
flip--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f6492.9%
Applied egg-rr92.9%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-lowering-*.f6477.4%
Simplified77.4%
associate-*l/N/A
neg-mul-1N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6482.6%
Applied egg-rr82.6%
sub0-negN/A
neg-lowering-neg.f6482.6%
Applied egg-rr82.6%
if -1.00000000000000006e-9 < (*.f64 z t) < 1.99999999999999996e-12Initial program 99.9%
Taylor expanded in y around inf
/-lowering-/.f6481.4%
Simplified81.4%
Final simplification82.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- 0.0 (/ x (* z t))))) (if (<= (* z t) -1.02e-86) t_1 (if (<= (* z t) 1.65) (/ x y) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.0 - (x / (z * t));
double tmp;
if ((z * t) <= -1.02e-86) {
tmp = t_1;
} else if ((z * t) <= 1.65) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: t_1
real(8) :: tmp
t_1 = 0.0d0 - (x / (z * t))
if ((z * t) <= (-1.02d-86)) then
tmp = t_1
else if ((z * t) <= 1.65d0) then
tmp = x / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 0.0 - (x / (z * t));
double tmp;
if ((z * t) <= -1.02e-86) {
tmp = t_1;
} else if ((z * t) <= 1.65) {
tmp = x / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.0 - (x / (z * t)) tmp = 0 if (z * t) <= -1.02e-86: tmp = t_1 elif (z * t) <= 1.65: tmp = x / y else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.0 - Float64(x / Float64(z * t))) tmp = 0.0 if (Float64(z * t) <= -1.02e-86) tmp = t_1; elseif (Float64(z * t) <= 1.65) tmp = Float64(x / y); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 0.0 - (x / (z * t));
tmp = 0.0;
if ((z * t) <= -1.02e-86)
tmp = t_1;
elseif ((z * t) <= 1.65)
tmp = x / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1.02e-86], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1.65], N[(x / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0 - \frac{x}{z \cdot t}\\
\mathbf{if}\;z \cdot t \leq -1.02 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 1.65:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.02000000000000005e-86 or 1.6499999999999999 < (*.f64 z t) Initial program 93.3%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
associate-/r*N/A
associate-/l*N/A
unpow2N/A
times-fracN/A
associate-/r*N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.2%
Simplified77.2%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6477.0%
Applied egg-rr77.0%
Taylor expanded in y around 0
/-lowering-/.f6478.5%
Simplified78.5%
associate-/r/N/A
*-commutativeN/A
div-invN/A
mul-1-negN/A
remove-double-negN/A
frac-2negN/A
associate-*r/N/A
div-invN/A
distribute-frac-neg2N/A
neg-lowering-neg.f64N/A
associate-/r*N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-lowering-*.f6475.8%
Applied egg-rr75.8%
if -1.02000000000000005e-86 < (*.f64 z t) < 1.6499999999999999Initial program 99.9%
Taylor expanded in y around inf
/-lowering-/.f6484.9%
Simplified84.9%
Final simplification79.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.2e+135) (/ 1.0 (* z (/ (- (/ y z) t) x))) (/ x (- y (* z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e+135) {
tmp = 1.0 / (z * (((y / z) - t) / x));
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: tmp
if (z <= (-1.2d+135)) then
tmp = 1.0d0 / (z * (((y / z) - t) / x))
else
tmp = x / (y - (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e+135) {
tmp = 1.0 / (z * (((y / z) - t) / x));
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.2e+135: tmp = 1.0 / (z * (((y / z) - t) / x)) else: tmp = x / (y - (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e+135) tmp = Float64(1.0 / Float64(z * Float64(Float64(Float64(y / z) - t) / x))); else tmp = Float64(x / Float64(y - Float64(z * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.2e+135)
tmp = 1.0 / (z * (((y / z) - t) / x));
else
tmp = x / (y - (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e+135], N[(1.0 / N[(z * N[(N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+135}:\\
\;\;\;\;\frac{1}{z \cdot \frac{\frac{y}{z} - t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if z < -1.19999999999999999e135Initial program 78.1%
Taylor expanded in z around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6478.2%
Simplified78.2%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
div-invN/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.2%
Applied egg-rr96.2%
if -1.19999999999999999e135 < z Initial program 98.6%
Final simplification98.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -5.1e+222) (/ (/ x (- (/ y z) t)) z) (/ x (- y (* z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.1e+222) {
tmp = (x / ((y / z) - t)) / z;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
real(8) :: tmp
if (z <= (-5.1d+222)) then
tmp = (x / ((y / z) - t)) / z
else
tmp = x / (y - (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.1e+222) {
tmp = (x / ((y / z) - t)) / z;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -5.1e+222: tmp = (x / ((y / z) - t)) / z else: tmp = x / (y - (z * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -5.1e+222) tmp = Float64(Float64(x / Float64(Float64(y / z) - t)) / z); else tmp = Float64(x / Float64(y - Float64(z * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -5.1e+222)
tmp = (x / ((y / z) - t)) / z;
else
tmp = x / (y - (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -5.1e+222], N[(N[(x / N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+222}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{z} - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if z < -5.0999999999999999e222Initial program 71.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6471.1%
Simplified71.1%
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6493.8%
Applied egg-rr93.8%
if -5.0999999999999999e222 < z Initial program 97.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / y;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / y;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / y
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / y) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / y;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y}
\end{array}
Initial program 96.2%
Taylor expanded in y around inf
/-lowering-/.f6454.0%
Simplified54.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(if (< x -1.618195973607049e+50)
t_1
(if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / ((y / x) - ((z / x) * t))
if (x < (-1.618195973607049d+50)) then
tmp = t_1
else if (x < 2.1378306434876444d+131) then
tmp = x / (y - (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 / ((y / x) - ((z / x) * t)) tmp = 0 if x < -1.618195973607049e+50: tmp = t_1 elif x < 2.1378306434876444e+131: tmp = x / (y - (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(Float64(y / x) - Float64(Float64(z / x) * t))) tmp = 0.0 if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 / ((y / x) - ((z / x) * t)); tmp = 0.0; if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = x / (y - (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[(y / x), $MachinePrecision] - N[(N[(z / x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[x, -1.618195973607049e+50], t$95$1, If[Less[x, 2.1378306434876444e+131], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\
\mathbf{if}\;x < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x < 2.1378306434876444 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024138
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< x -161819597360704900000000000000000000000000000000000) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 213783064348764440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t))))))
(/ x (- y (* z t))))