
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
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) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x)))
(if (<= (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0)) INFINITY)
(- (fma (/ y (+ x 1.0)) (/ z t_2) t_1) (/ t_1 t_2))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if (((x + (((y * z) - x) / t_2)) / (x + 1.0)) <= ((double) INFINITY)) {
tmp = fma((y / (x + 1.0)), (z / t_2), t_1) - (t_1 / t_2);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) <= Inf) tmp = Float64(fma(Float64(y / Float64(x + 1.0)), Float64(z / t_2), t_1) - Float64(t_1 / t_2)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{t_2}}{x + 1} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{x + 1}, \frac{z}{t_2}, t_1\right) - \frac{t_1}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 (- INFINITY))
(/ (+ x (/ y (/ t_1 z))) (+ x 1.0))
(if (<= t_2 2e+282)
t_2
(-
(+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0))))
(/ x (* t (* z (+ x 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = ((x / (x + 1.0)) + (y / (t * (x + 1.0)))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = ((x / (x + 1.0)) + (y / (t * (x + 1.0)))) - (x / (t * (z * (x + 1.0))));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -math.inf: tmp = (x + (y / (t_1 / z))) / (x + 1.0) elif t_2 <= 2e+282: tmp = t_2 else: tmp = ((x / (x + 1.0)) + (y / (t * (x + 1.0)))) - (x / (t * (z * (x + 1.0)))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y / Float64(t_1 / z))) / Float64(x + 1.0)); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = Float64(Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * Float64(x + 1.0)))) - Float64(x / Float64(t * Float64(z * Float64(x + 1.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -Inf) tmp = (x + (y / (t_1 / z))) / (x + 1.0); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = ((x / (x + 1.0)) + (y / (t * (x + 1.0)))) - (x / (t * (z * (x + 1.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x + N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+282], t$95$2, N[(N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(t * N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\right) - \frac{x}{t \cdot \left(z \cdot \left(x + 1\right)\right)}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 (- INFINITY))
(/ (+ x (/ y (/ t_1 z))) (+ x 1.0))
(if (<= t_2 2e+282) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -math.inf: tmp = (x + (y / (t_1 / z))) / (x + 1.0) elif t_2 <= 2e+282: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y / Float64(t_1 / z))) / Float64(x + 1.0)); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -Inf) tmp = (x + (y / (t_1 / z))) / (x + 1.0); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x + N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+282], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (or (<= y -2.6e-135) (not (<= y 1.3e-31)))
(/ (+ x (/ y (/ t_1 z))) (+ x 1.0))
(/ (- x (/ x t_1)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((y <= -2.6e-135) || !(y <= 1.3e-31)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
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 = (z * t) - x
if ((y <= (-2.6d-135)) .or. (.not. (y <= 1.3d-31))) then
tmp = (x + (y / (t_1 / z))) / (x + 1.0d0)
else
tmp = (x - (x / t_1)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((y <= -2.6e-135) || !(y <= 1.3e-31)) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if (y <= -2.6e-135) or not (y <= 1.3e-31): tmp = (x + (y / (t_1 / z))) / (x + 1.0) else: tmp = (x - (x / t_1)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if ((y <= -2.6e-135) || !(y <= 1.3e-31)) tmp = Float64(Float64(x + Float64(y / Float64(t_1 / z))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if ((y <= -2.6e-135) || ~((y <= 1.3e-31))) tmp = (x + (y / (t_1 / z))) / (x + 1.0); else tmp = (x - (x / t_1)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[y, -2.6e-135], N[Not[LessEqual[y, 1.3e-31]], $MachinePrecision]], N[(N[(x + N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{-135} \lor \neg \left(y \leq 1.3 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e-147) (not (<= z 1.5e-62))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-147) || !(z <= 1.5e-62)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
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) :: tmp
if ((z <= (-2.4d-147)) .or. (.not. (z <= 1.5d-62))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-147) || !(z <= 1.5e-62)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.4e-147) or not (z <= 1.5e-62): tmp = (x + (y / t)) / (x + 1.0) else: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e-147) || !(z <= 1.5e-62)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.4e-147) || ~((z <= 1.5e-62))) tmp = (x + (y / t)) / (x + 1.0); else tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e-147], N[Not[LessEqual[z, 1.5e-62]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-147} \lor \neg \left(z \leq 1.5 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -1.15e-98)
t_1
(if (<= x 1.15e-225)
(/ y t)
(if (<= x 1.9e-76) (* y (/ z (- (* z t) x))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -1.15e-98) {
tmp = t_1;
} else if (x <= 1.15e-225) {
tmp = y / t;
} else if (x <= 1.9e-76) {
tmp = y * (z / ((z * t) - x));
} 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 = x / (x + 1.0d0)
if (x <= (-1.15d-98)) then
tmp = t_1
else if (x <= 1.15d-225) then
tmp = y / t
else if (x <= 1.9d-76) then
tmp = y * (z / ((z * t) - x))
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 = x / (x + 1.0);
double tmp;
if (x <= -1.15e-98) {
tmp = t_1;
} else if (x <= 1.15e-225) {
tmp = y / t;
} else if (x <= 1.9e-76) {
tmp = y * (z / ((z * t) - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -1.15e-98: tmp = t_1 elif x <= 1.15e-225: tmp = y / t elif x <= 1.9e-76: tmp = y * (z / ((z * t) - x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -1.15e-98) tmp = t_1; elseif (x <= 1.15e-225) tmp = Float64(y / t); elseif (x <= 1.9e-76) tmp = Float64(y * Float64(z / Float64(Float64(z * t) - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -1.15e-98) tmp = t_1; elseif (x <= 1.15e-225) tmp = y / t; elseif (x <= 1.9e-76) tmp = y * (z / ((z * t) - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e-98], t$95$1, If[LessEqual[x, 1.15e-225], N[(y / t), $MachinePrecision], If[LessEqual[x, 1.9e-76], N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-225}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-76}:\\
\;\;\;\;y \cdot \frac{z}{z \cdot t - x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e-147) (not (<= z 5e-60))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (/ y (/ (* x (+ x 1.0)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-147) || !(z <= 5e-60)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / ((x * (x + 1.0)) / z));
}
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) :: tmp
if ((z <= (-2.4d-147)) .or. (.not. (z <= 5d-60))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (y / ((x * (x + 1.0d0)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-147) || !(z <= 5e-60)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / ((x * (x + 1.0)) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.4e-147) or not (z <= 5e-60): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y / ((x * (x + 1.0)) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e-147) || !(z <= 5e-60)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y / Float64(Float64(x * Float64(x + 1.0)) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.4e-147) || ~((z <= 5e-60))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y / ((x * (x + 1.0)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e-147], N[Not[LessEqual[z, 5e-60]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y / N[(N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-147} \lor \neg \left(z \leq 5 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{\frac{x \cdot \left(x + 1\right)}{z}}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -2.1e-98)
t_1
(if (<= x 1.02e-225)
(/ y t)
(if (<= x 1.05e-148)
(- 1.0 (* z (/ y x)))
(if (<= x 6.2e-78) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -2.1e-98) {
tmp = t_1;
} else if (x <= 1.02e-225) {
tmp = y / t;
} else if (x <= 1.05e-148) {
tmp = 1.0 - (z * (y / x));
} else if (x <= 6.2e-78) {
tmp = y / 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 = x / (x + 1.0d0)
if (x <= (-2.1d-98)) then
tmp = t_1
else if (x <= 1.02d-225) then
tmp = y / t
else if (x <= 1.05d-148) then
tmp = 1.0d0 - (z * (y / x))
else if (x <= 6.2d-78) then
tmp = y / 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 = x / (x + 1.0);
double tmp;
if (x <= -2.1e-98) {
tmp = t_1;
} else if (x <= 1.02e-225) {
tmp = y / t;
} else if (x <= 1.05e-148) {
tmp = 1.0 - (z * (y / x));
} else if (x <= 6.2e-78) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -2.1e-98: tmp = t_1 elif x <= 1.02e-225: tmp = y / t elif x <= 1.05e-148: tmp = 1.0 - (z * (y / x)) elif x <= 6.2e-78: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -2.1e-98) tmp = t_1; elseif (x <= 1.02e-225) tmp = Float64(y / t); elseif (x <= 1.05e-148) tmp = Float64(1.0 - Float64(z * Float64(y / x))); elseif (x <= 6.2e-78) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -2.1e-98) tmp = t_1; elseif (x <= 1.02e-225) tmp = y / t; elseif (x <= 1.05e-148) tmp = 1.0 - (z * (y / x)); elseif (x <= 6.2e-78) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e-98], t$95$1, If[LessEqual[x, 1.02e-225], N[(y / t), $MachinePrecision], If[LessEqual[x, 1.05e-148], N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e-78], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-225}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-148}:\\
\;\;\;\;1 - z \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-78}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -1.8e-98)
t_1
(if (<= x 1.65e-226)
(/ y t)
(if (<= x 2.4e-146)
(- 1.0 (/ y (/ x z)))
(if (<= x 6.5e-78) (/ y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -1.8e-98) {
tmp = t_1;
} else if (x <= 1.65e-226) {
tmp = y / t;
} else if (x <= 2.4e-146) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 6.5e-78) {
tmp = y / 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 = x / (x + 1.0d0)
if (x <= (-1.8d-98)) then
tmp = t_1
else if (x <= 1.65d-226) then
tmp = y / t
else if (x <= 2.4d-146) then
tmp = 1.0d0 - (y / (x / z))
else if (x <= 6.5d-78) then
tmp = y / 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 = x / (x + 1.0);
double tmp;
if (x <= -1.8e-98) {
tmp = t_1;
} else if (x <= 1.65e-226) {
tmp = y / t;
} else if (x <= 2.4e-146) {
tmp = 1.0 - (y / (x / z));
} else if (x <= 6.5e-78) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -1.8e-98: tmp = t_1 elif x <= 1.65e-226: tmp = y / t elif x <= 2.4e-146: tmp = 1.0 - (y / (x / z)) elif x <= 6.5e-78: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -1.8e-98) tmp = t_1; elseif (x <= 1.65e-226) tmp = Float64(y / t); elseif (x <= 2.4e-146) tmp = Float64(1.0 - Float64(y / Float64(x / z))); elseif (x <= 6.5e-78) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -1.8e-98) tmp = t_1; elseif (x <= 1.65e-226) tmp = y / t; elseif (x <= 2.4e-146) tmp = 1.0 - (y / (x / z)); elseif (x <= 6.5e-78) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e-98], t$95$1, If[LessEqual[x, 1.65e-226], N[(y / t), $MachinePrecision], If[LessEqual[x, 2.4e-146], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e-78], N[(y / t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-226}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-146}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.5e-148) (not (<= z 2.1e-63))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (/ y (/ x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.5e-148) || !(z <= 2.1e-63)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / (x / z));
}
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) :: tmp
if ((z <= (-8.5d-148)) .or. (.not. (z <= 2.1d-63))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (y / (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.5e-148) || !(z <= 2.1e-63)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y / (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.5e-148) or not (z <= 2.1e-63): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y / (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.5e-148) || !(z <= 2.1e-63)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y / Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -8.5e-148) || ~((z <= 2.1e-63))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y / (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.5e-148], N[Not[LessEqual[z, 2.1e-63]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-148} \lor \neg \left(z \leq 2.1 \cdot 10^{-63}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{\frac{x}{z}}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.85e-98) (not (<= x 6.4e-78))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.85e-98) || !(x <= 6.4e-78)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
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) :: tmp
if ((x <= (-1.85d-98)) .or. (.not. (x <= 6.4d-78))) then
tmp = x / (x + 1.0d0)
else
tmp = y / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.85e-98) || !(x <= 6.4e-78)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.85e-98) or not (x <= 6.4e-78): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.85e-98) || !(x <= 6.4e-78)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.85e-98) || ~((x <= 6.4e-78))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.85e-98], N[Not[LessEqual[x, 6.4e-78]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-98} \lor \neg \left(x \leq 6.4 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= x -3.2e-80) 1.0 (if (<= x 3.15e-31) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-80) {
tmp = 1.0;
} else if (x <= 3.15e-31) {
tmp = y / t;
} else {
tmp = 1.0;
}
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) :: tmp
if (x <= (-3.2d-80)) then
tmp = 1.0d0
else if (x <= 3.15d-31) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-80) {
tmp = 1.0;
} else if (x <= 3.15e-31) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.2e-80: tmp = 1.0 elif x <= 3.15e-31: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.2e-80) tmp = 1.0; elseif (x <= 3.15e-31) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.2e-80) tmp = 1.0; elseif (x <= 3.15e-31) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.2e-80], 1.0, If[LessEqual[x, 3.15e-31], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-80}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{-31}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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 = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
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 / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024010
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))