
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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 / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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 / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - 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 / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= z -4.2e+174)
t_1
(if (<= z -1.7e+144)
(/ (* x y) z)
(if (or (<= z -2.9e+126) (not (<= z 5.3e+23)))
t_1
(* x (- (/ y z) t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (z <= -4.2e+174) {
tmp = t_1;
} else if (z <= -1.7e+144) {
tmp = (x * y) / z;
} else if ((z <= -2.9e+126) || !(z <= 5.3e+23)) {
tmp = t_1;
} else {
tmp = x * ((y / z) - 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) :: t_1
real(8) :: tmp
t_1 = x / (z / t)
if (z <= (-4.2d+174)) then
tmp = t_1
else if (z <= (-1.7d+144)) then
tmp = (x * y) / z
else if ((z <= (-2.9d+126)) .or. (.not. (z <= 5.3d+23))) then
tmp = t_1
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (z <= -4.2e+174) {
tmp = t_1;
} else if (z <= -1.7e+144) {
tmp = (x * y) / z;
} else if ((z <= -2.9e+126) || !(z <= 5.3e+23)) {
tmp = t_1;
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if z <= -4.2e+174: tmp = t_1 elif z <= -1.7e+144: tmp = (x * y) / z elif (z <= -2.9e+126) or not (z <= 5.3e+23): tmp = t_1 else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (z <= -4.2e+174) tmp = t_1; elseif (z <= -1.7e+144) tmp = Float64(Float64(x * y) / z); elseif ((z <= -2.9e+126) || !(z <= 5.3e+23)) tmp = t_1; else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (z <= -4.2e+174) tmp = t_1; elseif (z <= -1.7e+144) tmp = (x * y) / z; elseif ((z <= -2.9e+126) || ~((z <= 5.3e+23))) tmp = t_1; else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+174], t$95$1, If[LessEqual[z, -1.7e+144], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -2.9e+126], N[Not[LessEqual[z, 5.3e+23]], $MachinePrecision]], t$95$1, N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+144}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{+126} \lor \neg \left(z \leq 5.3 \cdot 10^{+23}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t (+ z -1.0)))))
(if (<= z -1.05e+175)
t_1
(if (<= z -2.05e+145)
(/ (* x y) z)
(if (<= z -9.5e+126)
t_1
(if (<= z 2.1e+23) (* x (- (/ y z) t)) (/ x (/ z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (z <= -1.05e+175) {
tmp = t_1;
} else if (z <= -2.05e+145) {
tmp = (x * y) / z;
} else if (z <= -9.5e+126) {
tmp = t_1;
} else if (z <= 2.1e+23) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / 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) :: t_1
real(8) :: tmp
t_1 = x * (t / (z + (-1.0d0)))
if (z <= (-1.05d+175)) then
tmp = t_1
else if (z <= (-2.05d+145)) then
tmp = (x * y) / z
else if (z <= (-9.5d+126)) then
tmp = t_1
else if (z <= 2.1d+23) then
tmp = x * ((y / z) - t)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (z <= -1.05e+175) {
tmp = t_1;
} else if (z <= -2.05e+145) {
tmp = (x * y) / z;
} else if (z <= -9.5e+126) {
tmp = t_1;
} else if (z <= 2.1e+23) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z + -1.0)) tmp = 0 if z <= -1.05e+175: tmp = t_1 elif z <= -2.05e+145: tmp = (x * y) / z elif z <= -9.5e+126: tmp = t_1 elif z <= 2.1e+23: tmp = x * ((y / z) - t) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z + -1.0))) tmp = 0.0 if (z <= -1.05e+175) tmp = t_1; elseif (z <= -2.05e+145) tmp = Float64(Float64(x * y) / z); elseif (z <= -9.5e+126) tmp = t_1; elseif (z <= 2.1e+23) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z + -1.0)); tmp = 0.0; if (z <= -1.05e+175) tmp = t_1; elseif (z <= -2.05e+145) tmp = (x * y) / z; elseif (z <= -9.5e+126) tmp = t_1; elseif (z <= 2.1e+23) tmp = x * ((y / z) - t); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+175], t$95$1, If[LessEqual[z, -2.05e+145], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -9.5e+126], t$95$1, If[LessEqual[z, 2.1e+23], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{+145}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))) (t_2 (/ x (/ z t))))
(if (<= y -1.1e-190)
t_1
(if (<= y 2.9e-241)
t_2
(if (<= y 1.9e-153) (* x (- t)) (if (<= y 9e-134) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double t_2 = x / (z / t);
double tmp;
if (y <= -1.1e-190) {
tmp = t_1;
} else if (y <= 2.9e-241) {
tmp = t_2;
} else if (y <= 1.9e-153) {
tmp = x * -t;
} else if (y <= 9e-134) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * (y / z)
t_2 = x / (z / t)
if (y <= (-1.1d-190)) then
tmp = t_1
else if (y <= 2.9d-241) then
tmp = t_2
else if (y <= 1.9d-153) then
tmp = x * -t
else if (y <= 9d-134) then
tmp = t_2
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 * (y / z);
double t_2 = x / (z / t);
double tmp;
if (y <= -1.1e-190) {
tmp = t_1;
} else if (y <= 2.9e-241) {
tmp = t_2;
} else if (y <= 1.9e-153) {
tmp = x * -t;
} else if (y <= 9e-134) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) t_2 = x / (z / t) tmp = 0 if y <= -1.1e-190: tmp = t_1 elif y <= 2.9e-241: tmp = t_2 elif y <= 1.9e-153: tmp = x * -t elif y <= 9e-134: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) t_2 = Float64(x / Float64(z / t)) tmp = 0.0 if (y <= -1.1e-190) tmp = t_1; elseif (y <= 2.9e-241) tmp = t_2; elseif (y <= 1.9e-153) tmp = Float64(x * Float64(-t)); elseif (y <= 9e-134) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / z); t_2 = x / (z / t); tmp = 0.0; if (y <= -1.1e-190) tmp = t_1; elseif (y <= 2.9e-241) tmp = t_2; elseif (y <= 1.9e-153) tmp = x * -t; elseif (y <= 9e-134) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-190], t$95$1, If[LessEqual[y, 2.9e-241], t$95$2, If[LessEqual[y, 1.9e-153], N[(x * (-t)), $MachinePrecision], If[LessEqual[y, 9e-134], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
t_2 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-241}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-153}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-134}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= y -1e-190)
(* x (/ y z))
(if (<= y 2.75e-241)
t_1
(if (<= y 8.2e-154)
(* x (- t))
(if (<= y 3.1e-132) t_1 (/ x (/ z y))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (y <= -1e-190) {
tmp = x * (y / z);
} else if (y <= 2.75e-241) {
tmp = t_1;
} else if (y <= 8.2e-154) {
tmp = x * -t;
} else if (y <= 3.1e-132) {
tmp = t_1;
} else {
tmp = x / (z / y);
}
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 / (z / t)
if (y <= (-1d-190)) then
tmp = x * (y / z)
else if (y <= 2.75d-241) then
tmp = t_1
else if (y <= 8.2d-154) then
tmp = x * -t
else if (y <= 3.1d-132) then
tmp = t_1
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (y <= -1e-190) {
tmp = x * (y / z);
} else if (y <= 2.75e-241) {
tmp = t_1;
} else if (y <= 8.2e-154) {
tmp = x * -t;
} else if (y <= 3.1e-132) {
tmp = t_1;
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if y <= -1e-190: tmp = x * (y / z) elif y <= 2.75e-241: tmp = t_1 elif y <= 8.2e-154: tmp = x * -t elif y <= 3.1e-132: tmp = t_1 else: tmp = x / (z / y) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (y <= -1e-190) tmp = Float64(x * Float64(y / z)); elseif (y <= 2.75e-241) tmp = t_1; elseif (y <= 8.2e-154) tmp = Float64(x * Float64(-t)); elseif (y <= 3.1e-132) tmp = t_1; else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (y <= -1e-190) tmp = x * (y / z); elseif (y <= 2.75e-241) tmp = t_1; elseif (y <= 8.2e-154) tmp = x * -t; elseif (y <= 3.1e-132) tmp = t_1; else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-190], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.75e-241], t$95$1, If[LessEqual[y, 8.2e-154], N[(x * (-t)), $MachinePrecision], If[LessEqual[y, 3.1e-132], t$95$1, N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-190}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-154}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-132}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))))
(if (<= y -6.2e-164)
t_1
(if (<= y 1.75e-251)
(* t (/ x z))
(if (<= y 2.65e-158) (* x (- t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double tmp;
if (y <= -6.2e-164) {
tmp = t_1;
} else if (y <= 1.75e-251) {
tmp = t * (x / z);
} else if (y <= 2.65e-158) {
tmp = x * -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 * (y / z)
if (y <= (-6.2d-164)) then
tmp = t_1
else if (y <= 1.75d-251) then
tmp = t * (x / z)
else if (y <= 2.65d-158) then
tmp = x * -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 * (y / z);
double tmp;
if (y <= -6.2e-164) {
tmp = t_1;
} else if (y <= 1.75e-251) {
tmp = t * (x / z);
} else if (y <= 2.65e-158) {
tmp = x * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) tmp = 0 if y <= -6.2e-164: tmp = t_1 elif y <= 1.75e-251: tmp = t * (x / z) elif y <= 2.65e-158: tmp = x * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) tmp = 0.0 if (y <= -6.2e-164) tmp = t_1; elseif (y <= 1.75e-251) tmp = Float64(t * Float64(x / z)); elseif (y <= 2.65e-158) tmp = Float64(x * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / z); tmp = 0.0; if (y <= -6.2e-164) tmp = t_1; elseif (y <= 1.75e-251) tmp = t * (x / z); elseif (y <= 2.65e-158) tmp = x * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e-164], t$95$1, If[LessEqual[y, 1.75e-251], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-158], N[(x * (-t)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{-164}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-251}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-158}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -280000000.0) (not (<= z 1.65e-6))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -280000000.0) || !(z <= 1.65e-6)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - 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 ((z <= (-280000000.0d0)) .or. (.not. (z <= 1.65d-6))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -280000000.0) || !(z <= 1.65e-6)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -280000000.0) or not (z <= 1.65e-6): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -280000000.0) || !(z <= 1.65e-6)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -280000000.0) || ~((z <= 1.65e-6))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -280000000.0], N[Not[LessEqual[z, 1.65e-6]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -280000000 \lor \neg \left(z \leq 1.65 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= z -280000000.0) (* x (/ (+ y t) z)) (if (<= z 1.65e-6) (* x (- (/ y z) t)) (/ x (/ z (+ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -280000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= 1.65e-6) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / (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 (z <= (-280000000.0d0)) then
tmp = x * ((y + t) / z)
else if (z <= 1.65d-6) then
tmp = x * ((y / z) - t)
else
tmp = x / (z / (y + t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -280000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= 1.65e-6) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / (y + t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -280000000.0: tmp = x * ((y + t) / z) elif z <= 1.65e-6: tmp = x * ((y / z) - t) else: tmp = x / (z / (y + t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -280000000.0) tmp = Float64(x * Float64(Float64(y + t) / z)); elseif (z <= 1.65e-6) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x / Float64(z / Float64(y + t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -280000000.0) tmp = x * ((y + t) / z); elseif (z <= 1.65e-6) tmp = x * ((y / z) - t); else tmp = x / (z / (y + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -280000000.0], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-6], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -280000000:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -800000.0) (not (<= z 15600.0))) (* t (/ x z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -800000.0) || !(z <= 15600.0)) {
tmp = t * (x / z);
} else {
tmp = x * -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 ((z <= (-800000.0d0)) .or. (.not. (z <= 15600.0d0))) then
tmp = t * (x / z)
else
tmp = x * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -800000.0) || !(z <= 15600.0)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -800000.0) or not (z <= 15600.0): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -800000.0) || !(z <= 15600.0)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -800000.0) || ~((z <= 15600.0))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -800000.0], N[Not[LessEqual[z, 15600.0]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -800000 \lor \neg \left(z \leq 15600\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (- t)))
double code(double x, double y, double z, double t) {
return x * -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 * -t
end function
public static double code(double x, double y, double z, double t) {
return x * -t;
}
def code(x, y, z, t): return x * -t
function code(x, y, z, t) return Float64(x * Float64(-t)) end
function tmp = code(x, y, z, t) tmp = x * -t; end
code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-t\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} 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) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
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 * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024008
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))