
(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 10 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 -2.4) (not (<= y 8.2e-92))) (+ x (/ (exp (- z)) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.4) || !(y <= 8.2e-92)) {
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 <= (-2.4d0)) .or. (.not. (y <= 8.2d-92))) 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 <= -2.4) || !(y <= 8.2e-92)) {
tmp = x + (Math.exp(-z) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.4) or not (y <= 8.2e-92): tmp = x + (math.exp(-z) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.4) || !(y <= 8.2e-92)) 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 <= -2.4) || ~((y <= 8.2e-92))) tmp = x + (exp(-z) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.4], N[Not[LessEqual[y, 8.2e-92]], $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 -2.4 \lor \neg \left(y \leq 8.2 \cdot 10^{-92}\right):\\
\;\;\;\;x + \frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -2.39999999999999991 or 8.2000000000000005e-92 < y Initial program 85.3%
*-commutative85.3%
exp-to-pow85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -2.39999999999999991 < y < 8.2000000000000005e-92Initial program 81.8%
exp-prod100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (<= z -1.5e+38) (/ (exp (- z)) y) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.5e+38) {
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 <= (-1.5d+38)) 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 <= -1.5e+38) {
tmp = Math.exp(-z) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.5e+38: tmp = math.exp(-z) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.5e+38) 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 <= -1.5e+38) tmp = exp(-z) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.5e+38], 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 -1.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{e^{-z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -1.5000000000000001e38Initial program 48.4%
*-commutative48.4%
exp-to-pow48.4%
+-commutative48.4%
Simplified48.4%
Taylor expanded in y around inf 71.6%
mul-1-neg71.6%
Simplified71.6%
Taylor expanded in x around 0 71.6%
if -1.5000000000000001e38 < z Initial program 92.1%
exp-prod96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in y around inf 94.1%
(FPCore (x y z)
:precision binary64
(if (<= y -8.2e+186)
x
(if (<= y -1.26)
(+ 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 <= -8.2e+186) {
tmp = x;
} else if (y <= -1.26) {
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 <= (-8.2d+186)) then
tmp = x
else if (y <= (-1.26d0)) 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 <= -8.2e+186) {
tmp = x;
} else if (y <= -1.26) {
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 <= -8.2e+186: tmp = x elif y <= -1.26: 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 <= -8.2e+186) tmp = x; elseif (y <= -1.26) 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 <= -8.2e+186) tmp = x; elseif (y <= -1.26) 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, -8.2e+186], x, If[LessEqual[y, -1.26], 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 -8.2 \cdot 10^{+186}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.26:\\
\;\;\;\;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 < -8.2e186Initial program 78.6%
exp-prod78.6%
+-commutative78.6%
Simplified78.6%
Taylor expanded in x around inf 78.5%
if -8.2e186 < y < -1.26000000000000001Initial program 91.3%
*-commutative91.3%
exp-to-pow91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 86.2%
if -1.26000000000000001 < y Initial program 82.8%
exp-prod91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in y around inf 89.2%
Final simplification87.2%
(FPCore (x y z) :precision binary64 (if (<= y -1.18) (+ x (/ (+ 1.0 (* 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 (y <= -1.18) {
tmp = x + ((1.0 + (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 (y <= (-1.18d0)) then
tmp = x + ((1.0d0 + (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 (y <= -1.18) {
tmp = x + ((1.0 + (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 y <= -1.18: tmp = x + ((1.0 + (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 (y <= -1.18) tmp = Float64(x + Float64(Float64(1.0 + 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 (y <= -1.18) tmp = x + ((1.0 + (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[y, -1.18], N[(x + N[(N[(1.0 + N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $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 -1.18:\\
\;\;\;\;x + \frac{1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1.17999999999999994Initial program 86.7%
*-commutative86.7%
exp-to-pow86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 84.5%
if -1.17999999999999994 < y Initial program 82.8%
exp-prod91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in y around inf 89.2%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (<= y -1.55) (+ x (/ (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) y)) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.55) {
tmp = x + ((1.0 + (z * ((z * (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 (y <= (-1.55d0)) then
tmp = x + ((1.0d0 + (z * ((z * (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 (y <= -1.55) {
tmp = x + ((1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0))) / y);
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.55: tmp = x + ((1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0))) / y) else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.55) tmp = Float64(x + Float64(Float64(1.0 + Float64(z * Float64(Float64(z * 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 (y <= -1.55) tmp = x + ((1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0))) / y); else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.55], N[(x + N[(N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $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 -1.55:\\
\;\;\;\;x + \frac{1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if y < -1.55000000000000004Initial program 86.7%
*-commutative86.7%
exp-to-pow86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in y around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 84.5%
Taylor expanded in z around inf 84.5%
*-commutative84.5%
Simplified84.5%
if -1.55000000000000004 < y Initial program 82.8%
exp-prod91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in y around inf 89.2%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (<= z -1.9e+154) (/ (+ 1.0 (* z (* z 0.5))) y) (if (<= z -9e+121) (/ (/ (- y (* y z)) y) y) (+ x (/ 1.0 y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+154) {
tmp = (1.0 + (z * (z * 0.5))) / y;
} else if (z <= -9e+121) {
tmp = ((y - (y * z)) / y) / 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.9d+154)) then
tmp = (1.0d0 + (z * (z * 0.5d0))) / y
else if (z <= (-9d+121)) then
tmp = ((y - (y * z)) / y) / 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.9e+154) {
tmp = (1.0 + (z * (z * 0.5))) / y;
} else if (z <= -9e+121) {
tmp = ((y - (y * z)) / y) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.9e+154: tmp = (1.0 + (z * (z * 0.5))) / y elif z <= -9e+121: tmp = ((y - (y * z)) / y) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.9e+154) tmp = Float64(Float64(1.0 + Float64(z * Float64(z * 0.5))) / y); elseif (z <= -9e+121) tmp = Float64(Float64(Float64(y - Float64(y * z)) / y) / 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.9e+154) tmp = (1.0 + (z * (z * 0.5))) / y; elseif (z <= -9e+121) tmp = ((y - (y * z)) / y) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.9e+154], N[(N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, -9e+121], N[(N[(N[(y - N[(y * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+154}:\\
\;\;\;\;\frac{1 + z \cdot \left(z \cdot 0.5\right)}{y}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{+121}:\\
\;\;\;\;\frac{\frac{y - y \cdot z}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -1.8999999999999999e154Initial program 68.0%
*-commutative68.0%
exp-to-pow68.0%
+-commutative68.0%
Simplified68.0%
Taylor expanded in y around inf 64.0%
mul-1-neg64.0%
Simplified64.0%
Taylor expanded in z around 0 64.0%
Taylor expanded in y around 0 64.0%
Taylor expanded in z around inf 64.0%
*-commutative64.0%
Simplified64.0%
if -1.8999999999999999e154 < z < -9.0000000000000007e121Initial program 1.4%
exp-prod1.4%
+-commutative1.4%
Simplified1.4%
Taylor expanded in y around -inf 1.6%
associate-*r/1.6%
sub-neg1.6%
metadata-eval1.6%
distribute-lft-in1.6%
metadata-eval1.6%
+-commutative1.6%
mul-1-neg1.6%
unsub-neg1.6%
Simplified1.6%
Taylor expanded in x around 0 2.5%
frac-sub0.0%
associate-/r*100.0%
*-un-lft-identity100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -9.0000000000000007e121 < z Initial program 87.6%
exp-prod92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 89.0%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (<= z -1.1e+129) (/ (+ 1.0 (* z (* z 0.5))) y) (+ x (/ 1.0 y))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.1e+129) {
tmp = (1.0 + (z * (z * 0.5))) / 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.1d+129)) then
tmp = (1.0d0 + (z * (z * 0.5d0))) / 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.1e+129) {
tmp = (1.0 + (z * (z * 0.5))) / y;
} else {
tmp = x + (1.0 / y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.1e+129: tmp = (1.0 + (z * (z * 0.5))) / y else: tmp = x + (1.0 / y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.1e+129) tmp = Float64(Float64(1.0 + Float64(z * Float64(z * 0.5))) / 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.1e+129) tmp = (1.0 + (z * (z * 0.5))) / y; else tmp = x + (1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.1e+129], N[(N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+129}:\\
\;\;\;\;\frac{1 + z \cdot \left(z \cdot 0.5\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\end{array}
if z < -1.1e129Initial program 56.5%
*-commutative56.5%
exp-to-pow56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in y around inf 70.2%
mul-1-neg70.2%
Simplified70.2%
Taylor expanded in z around 0 53.3%
Taylor expanded in y around 0 53.6%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
Simplified53.6%
if -1.1e129 < z Initial program 87.6%
exp-prod92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in y around inf 89.0%
(FPCore (x y z) :precision binary64 (if (<= y -1.15e+16) x (if (<= y 4e-89) (/ 1.0 y) x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.15e+16) {
tmp = x;
} else if (y <= 4e-89) {
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 <= (-1.15d+16)) then
tmp = x
else if (y <= 4d-89) 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 <= -1.15e+16) {
tmp = x;
} else if (y <= 4e-89) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.15e+16: tmp = x elif y <= 4e-89: tmp = 1.0 / y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.15e+16) tmp = x; elseif (y <= 4e-89) tmp = Float64(1.0 / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.15e+16) tmp = x; elseif (y <= 4e-89) tmp = 1.0 / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.15e+16], x, If[LessEqual[y, 4e-89], N[(1.0 / y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-89}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.15e16 or 4.00000000000000015e-89 < y Initial program 84.7%
exp-prod84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in x around inf 66.2%
if -1.15e16 < y < 4.00000000000000015e-89Initial program 83.0%
exp-prod100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 73.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 84.1%
exp-prod90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 82.6%
(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 84.1%
exp-prod90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in x around inf 50.2%
(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 2024165
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ y (+ z y)) 17788539399477/2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y))))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))