
(FPCore (x y z) :precision binary64 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
double code(double x, double y, double z) {
return x + (exp((y * log((y / (z + y))))) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (exp((y * log((y / (z + y))))) / y)
end function
public static double code(double x, double y, double z) {
return x + (Math.exp((y * Math.log((y / (z + y))))) / y);
}
def code(x, y, z): return x + (math.exp((y * math.log((y / (z + y))))) / y)
function code(x, y, z) return Float64(x + Float64(exp(Float64(y * log(Float64(y / Float64(z + y))))) / y)) end
function tmp = code(x, y, z) tmp = x + (exp((y * log((y / (z + y))))) / y); end
code[x_, y_, z_] := N[(x + N[(N[Exp[N[(y * N[Log[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ (exp (* y (log (/ y (+ z y))))) y)))
double code(double x, double y, double z) {
return x + (exp((y * log((y / (z + y))))) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (exp((y * log((y / (z + y))))) / y)
end function
public static double code(double x, double y, double z) {
return x + (Math.exp((y * Math.log((y / (z + y))))) / y);
}
def code(x, y, z): return x + (math.exp((y * math.log((y / (z + y))))) / y)
function code(x, y, z) return Float64(x + Float64(exp(Float64(y * log(Float64(y / Float64(z + y))))) / y)) end
function tmp = code(x, y, z) tmp = x + (exp((y * log((y / (z + y))))) / y); end
code[x_, y_, z_] := N[(x + N[(N[Exp[N[(y * N[Log[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -2e+51) (not (<= y 0.000195))) (+ x (/ (exp (- z)) y)) (+ x (/ (pow (exp y) (log (/ y (+ y z)))) y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+51) || !(y <= 0.000195)) {
tmp = x + (exp(-z) / y);
} else {
tmp = x + (pow(exp(y), log((y / (y + z)))) / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2d+51)) .or. (.not. (y <= 0.000195d0))) then
tmp = x + (exp(-z) / y)
else
tmp = x + ((exp(y) ** log((y / (y + z)))) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2e+51) || !(y <= 0.000195)) {
tmp = x + (Math.exp(-z) / y);
} else {
tmp = x + (Math.pow(Math.exp(y), Math.log((y / (y + z)))) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2e+51) or not (y <= 0.000195): tmp = x + (math.exp(-z) / y) else: tmp = x + (math.pow(math.exp(y), math.log((y / (y + z)))) / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2e+51) || !(y <= 0.000195)) tmp = Float64(x + Float64(exp(Float64(-z)) / y)); else tmp = Float64(x + Float64((exp(y) ^ log(Float64(y / Float64(y + z)))) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2e+51) || ~((y <= 0.000195))) tmp = x + (exp(-z) / y); else tmp = x + ((exp(y) ^ log((y / (y + z)))) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2e+51], N[Not[LessEqual[y, 0.000195]], $MachinePrecision]], N[(x + N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Power[N[Exp[y], $MachinePrecision], N[Log[N[(y / N[(y + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+51} \lor \neg \left(y \leq 0.000195\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\log \left(\frac{y}{y + z}\right)}}{y}\\
\end{array}
\end{array}
if y < -2e51 or 1.94999999999999996e-4 < y Initial program 87.6%
*-commutative87.6%
exp-to-pow87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 99.8%
mul-1-neg99.8%
Simplified99.8%
if -2e51 < y < 1.94999999999999996e-4Initial program 86.0%
exp-prod99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.25) (not (<= y 0.000195))) (+ x (/ (exp (- z)) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.25) || !(y <= 0.000195)) {
tmp = x + (exp(-z) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.25d0)) .or. (.not. (y <= 0.000195d0))) then
tmp = x + (exp(-z) / y)
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.25) || !(y <= 0.000195)) {
tmp = x + (Math.exp(-z) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.25) or not (y <= 0.000195): tmp = x + (math.exp(-z) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.25) || !(y <= 0.000195)) tmp = Float64(x + Float64(exp(Float64(-z)) / y)); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.25) || ~((y <= 0.000195))) tmp = x + (exp(-z) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.25], N[Not[LessEqual[y, 0.000195]], $MachinePrecision]], N[(x + N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \lor \neg \left(y \leq 0.000195\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1.25 or 1.94999999999999996e-4 < y Initial program 88.4%
*-commutative88.4%
exp-to-pow88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 99.8%
mul-1-neg99.8%
Simplified99.8%
if -1.25 < y < 1.94999999999999996e-4Initial program 84.6%
exp-prod99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around inf 97.5%
+-commutative97.5%
Simplified97.5%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (<= z -82000.0) (/ (exp (- z)) y) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -82000.0) {
tmp = exp(-z) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-82000.0d0)) then
tmp = exp(-z) / y
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -82000.0) {
tmp = Math.exp(-z) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -82000.0: tmp = math.exp(-z) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -82000.0) tmp = Float64(exp(Float64(-z)) / y); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -82000.0) tmp = exp(-z) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -82000.0], N[(N[Exp[(-z)], $MachinePrecision] / y), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -82000:\\
\;\;\;\;\frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -82000Initial program 58.7%
exp-prod71.1%
+-commutative71.1%
Simplified71.1%
Taylor expanded in x around 0 58.3%
Taylor expanded in y around inf 70.5%
mul-1-neg70.5%
Simplified70.5%
if -82000 < z Initial program 93.9%
exp-prod97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in y around inf 96.0%
+-commutative96.0%
Simplified96.0%
Final simplification91.0%
(FPCore (x y z)
:precision binary64
(if (<= z -3.6e+96)
(+
x
(+
(/ 1.0 y)
(/ (* z (+ (* z (+ 0.5 (* z -0.16666666666666666))) -1.0)) y)))
(+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+96) {
tmp = x + ((1.0 / y) + ((z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)) / y));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.6d+96)) then
tmp = x + ((1.0d0 / y) + ((z * ((z * (0.5d0 + (z * (-0.16666666666666666d0)))) + (-1.0d0))) / y))
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+96) {
tmp = x + ((1.0 / y) + ((z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)) / y));
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.6e+96: tmp = x + ((1.0 / y) + ((z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)) / y)) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.6e+96) tmp = Float64(x + Float64(Float64(1.0 / y) + Float64(Float64(z * Float64(Float64(z * Float64(0.5 + Float64(z * -0.16666666666666666))) + -1.0)) / y))); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.6e+96) tmp = x + ((1.0 / y) + ((z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)) / y)); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.6e+96], N[(x + N[(N[(1.0 / y), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+96}:\\
\;\;\;\;x + \left(\frac{1}{y} + \frac{z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -3.60000000000000013e96Initial program 59.5%
*-commutative59.5%
exp-to-pow59.6%
+-commutative59.6%
Simplified59.6%
Taylor expanded in y around inf 70.6%
mul-1-neg70.6%
Simplified70.6%
Taylor expanded in z around 0 41.4%
Taylor expanded in y around 0 65.3%
if -3.60000000000000013e96 < z Initial program 91.2%
exp-prod94.8%
+-commutative94.8%
Simplified94.8%
Taylor expanded in y around inf 91.3%
+-commutative91.3%
Simplified91.3%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (if (<= y -0.84) (+ x (/ (+ 1.0 (* z (+ (* z 0.5) -1.0))) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.84) {
tmp = x + ((1.0 + (z * ((z * 0.5) + -1.0))) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-0.84d0)) then
tmp = x + ((1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))) / y)
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -0.84) {
tmp = x + ((1.0 + (z * ((z * 0.5) + -1.0))) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.84: tmp = x + ((1.0 + (z * ((z * 0.5) + -1.0))) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.84) tmp = Float64(x + Float64(Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0))) / y)); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -0.84) tmp = x + ((1.0 + (z * ((z * 0.5) + -1.0))) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.84], N[(x + N[(N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.84:\\
\;\;\;\;x + \frac{1 + z \cdot \left(z \cdot 0.5 + -1\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -0.839999999999999969Initial program 92.3%
*-commutative92.3%
exp-to-pow92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 72.1%
Taylor expanded in y around 0 77.7%
if -0.839999999999999969 < y Initial program 84.3%
exp-prod92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 90.3%
+-commutative90.3%
Simplified90.3%
Final simplification86.2%
(FPCore (x y z) :precision binary64 (if (<= y -2.35e-14) x (if (<= y 6e-66) (/ 1.0 y) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.35e-14) {
tmp = x;
} else if (y <= 6e-66) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.35d-14)) then
tmp = x
else if (y <= 6d-66) then
tmp = 1.0d0 / y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.35e-14) {
tmp = x;
} else if (y <= 6e-66) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.35e-14: tmp = x elif y <= 6e-66: tmp = 1.0 / y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.35e-14) tmp = x; elseif (y <= 6e-66) tmp = Float64(1.0 / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.35e-14) tmp = x; elseif (y <= 6e-66) tmp = 1.0 / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.35e-14], x, If[LessEqual[y, 6e-66], N[(1.0 / y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-66}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.3500000000000001e-14 or 6.0000000000000004e-66 < y Initial program 89.5%
exp-prod88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in x around inf 62.6%
if -2.3500000000000001e-14 < y < 6.0000000000000004e-66Initial program 81.6%
exp-prod100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 80.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.7e+89) (/ (+ 1.0 (* y x)) y) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.7e+89) {
tmp = (1.0 + (y * x)) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.7d+89)) then
tmp = (1.0d0 + (y * x)) / y
else
tmp = x + (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.7e+89) {
tmp = (1.0 + (y * x)) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.7e+89: tmp = (1.0 + (y * x)) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.7e+89) tmp = Float64(Float64(1.0 + Float64(y * x)) / y); else tmp = Float64(x + Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.7e+89) tmp = (1.0 + (y * x)) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.7e+89], N[(N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+89}:\\
\;\;\;\;\frac{1 + y \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -1.7000000000000001e89Initial program 59.1%
exp-prod76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in y around inf 31.8%
+-commutative31.8%
Simplified31.8%
Taylor expanded in y around 0 44.6%
if -1.7000000000000001e89 < z Initial program 91.6%
exp-prod95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 91.6%
+-commutative91.6%
Simplified91.6%
Final simplification84.8%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 y)))
double code(double x, double y, double z) {
return x + (1.0 / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (1.0d0 / y)
end function
public static double code(double x, double y, double z) {
return x + (1.0 / y);
}
def code(x, y, z): return x + (1.0 / y)
function code(x, y, z) return Float64(x + Float64(1.0 / y)) end
function tmp = code(x, y, z) tmp = x + (1.0 / y); end
code[x_, y_, z_] := N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{y}
\end{array}
Initial program 86.9%
exp-prod92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 83.0%
+-commutative83.0%
Simplified83.0%
Final simplification83.0%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 86.9%
exp-prod92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in x around inf 48.9%
(FPCore (x y z) :precision binary64 (if (< (/ y (+ z y)) 7.11541576e-315) (+ x (/ (exp (/ -1.0 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y))))
double code(double x, double y, double z) {
double tmp;
if ((y / (z + y)) < 7.11541576e-315) {
tmp = x + (exp((-1.0 / z)) / y);
} else {
tmp = x + (exp(log(pow((y / (y + z)), y))) / y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y / (z + y)) < 7.11541576d-315) then
tmp = x + (exp(((-1.0d0) / z)) / y)
else
tmp = x + (exp(log(((y / (y + z)) ** y))) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y / (z + y)) < 7.11541576e-315) {
tmp = x + (Math.exp((-1.0 / z)) / y);
} else {
tmp = x + (Math.exp(Math.log(Math.pow((y / (y + z)), y))) / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y / (z + y)) < 7.11541576e-315: tmp = x + (math.exp((-1.0 / z)) / y) else: tmp = x + (math.exp(math.log(math.pow((y / (y + z)), y))) / y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y / Float64(z + y)) < 7.11541576e-315) tmp = Float64(x + Float64(exp(Float64(-1.0 / z)) / y)); else tmp = Float64(x + Float64(exp(log((Float64(y / Float64(y + z)) ^ y))) / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y / (z + y)) < 7.11541576e-315) tmp = x + (exp((-1.0 / z)) / y); else tmp = x + (exp(log(((y / (y + z)) ^ y))) / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[N[(y / N[(z + y), $MachinePrecision]), $MachinePrecision], 7.11541576e-315], N[(x + N[(N[Exp[N[(-1.0 / z), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Exp[N[Log[N[Power[N[(y / N[(y + z), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y}{z + y} < 7.11541576 \cdot 10^{-315}:\\
\;\;\;\;x + \frac{e^{\frac{-1}{z}}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{\log \left({\left(\frac{y}{y + z}\right)}^{y}\right)}}{y}\\
\end{array}
\end{array}
herbie shell --seed 2024105
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:alt
(if (< (/ y (+ z y)) 7.11541576e-315) (+ x (/ (exp (/ -1.0 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))