
(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 12 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 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 (- INFINITY)) (* (* y x) (/ 1.0 z)) (* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * x) * (1.0 / z);
} else {
tmp = t_1 * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * x) * (1.0 / z);
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = (y * x) * (1.0 / z) else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * x) * Float64(1.0 / z)); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * x) * (1.0 / z); else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * x), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0Initial program 60.9%
Taylor expanded in y around inf 99.7%
associate-/l*63.0%
Simplified63.0%
associate-/l*99.7%
div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 97.6%
Final simplification97.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= t -4.8e+145)
t_1
(if (<= t -3.4e-279)
(* y (/ x z))
(if (<= t 1.05e+133) (/ x (/ z y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -4.8e+145) {
tmp = t_1;
} else if (t <= -3.4e-279) {
tmp = y * (x / z);
} else if (t <= 1.05e+133) {
tmp = x / (z / y);
} 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 / (z / t)
if (t <= (-4.8d+145)) then
tmp = t_1
else if (t <= (-3.4d-279)) then
tmp = y * (x / z)
else if (t <= 1.05d+133) then
tmp = x / (z / y)
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 / (z / t);
double tmp;
if (t <= -4.8e+145) {
tmp = t_1;
} else if (t <= -3.4e-279) {
tmp = y * (x / z);
} else if (t <= 1.05e+133) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if t <= -4.8e+145: tmp = t_1 elif t <= -3.4e-279: tmp = y * (x / z) elif t <= 1.05e+133: tmp = x / (z / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (t <= -4.8e+145) tmp = t_1; elseif (t <= -3.4e-279) tmp = Float64(y * Float64(x / z)); elseif (t <= 1.05e+133) tmp = Float64(x / Float64(z / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (t <= -4.8e+145) tmp = t_1; elseif (t <= -3.4e-279) tmp = y * (x / z); elseif (t <= 1.05e+133) tmp = x / (z / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+145], t$95$1, If[LessEqual[t, -3.4e-279], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+133], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-279}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+133}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.79999999999999984e145 or 1.05e133 < t Initial program 98.2%
Taylor expanded in z around inf 60.7%
associate-/l*73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in t around inf 62.2%
if -4.79999999999999984e145 < t < -3.40000000000000015e-279Initial program 94.5%
Taylor expanded in y around inf 70.3%
associate-/l*70.4%
associate-/r/74.7%
Simplified74.7%
if -3.40000000000000015e-279 < t < 1.05e133Initial program 95.8%
Taylor expanded in y around inf 70.5%
associate-/l*74.1%
Simplified74.1%
Final simplification71.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= t -3.6e+145)
t_1
(if (<= t -5e-270)
(/ y (/ z x))
(if (<= t 1.6e+131) (/ x (/ z y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -3.6e+145) {
tmp = t_1;
} else if (t <= -5e-270) {
tmp = y / (z / x);
} else if (t <= 1.6e+131) {
tmp = x / (z / y);
} 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 / (z / t)
if (t <= (-3.6d+145)) then
tmp = t_1
else if (t <= (-5d-270)) then
tmp = y / (z / x)
else if (t <= 1.6d+131) then
tmp = x / (z / y)
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 / (z / t);
double tmp;
if (t <= -3.6e+145) {
tmp = t_1;
} else if (t <= -5e-270) {
tmp = y / (z / x);
} else if (t <= 1.6e+131) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if t <= -3.6e+145: tmp = t_1 elif t <= -5e-270: tmp = y / (z / x) elif t <= 1.6e+131: tmp = x / (z / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (t <= -3.6e+145) tmp = t_1; elseif (t <= -5e-270) tmp = Float64(y / Float64(z / x)); elseif (t <= 1.6e+131) tmp = Float64(x / Float64(z / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (t <= -3.6e+145) tmp = t_1; elseif (t <= -5e-270) tmp = y / (z / x); elseif (t <= 1.6e+131) tmp = x / (z / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+145], t$95$1, If[LessEqual[t, -5e-270], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+131], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5 \cdot 10^{-270}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.59999999999999974e145 or 1.6000000000000001e131 < t Initial program 98.2%
Taylor expanded in z around inf 60.7%
associate-/l*73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in t around inf 62.2%
if -3.59999999999999974e145 < t < -4.9999999999999998e-270Initial program 94.5%
Taylor expanded in y around inf 70.3%
associate-/l*70.4%
associate-/r/74.7%
Simplified74.7%
*-commutative74.7%
clear-num74.1%
un-div-inv74.9%
Applied egg-rr74.9%
if -4.9999999999999998e-270 < t < 1.6000000000000001e131Initial program 95.8%
Taylor expanded in y around inf 70.5%
associate-/l*74.1%
Simplified74.1%
Final simplification71.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.25e+22) (not (<= z 0.00059))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e+22) || !(z <= 0.00059)) {
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 <= (-2.25d+22)) .or. (.not. (z <= 0.00059d0))) 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 <= -2.25e+22) || !(z <= 0.00059)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.25e+22) or not (z <= 0.00059): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.25e+22) || !(z <= 0.00059)) 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 <= -2.25e+22) || ~((z <= 0.00059))) 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, -2.25e+22], N[Not[LessEqual[z, 0.00059]], $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 -2.25 \cdot 10^{+22} \lor \neg \left(z \leq 0.00059\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.2499999999999999e22 or 5.9000000000000003e-4 < z Initial program 97.9%
Taylor expanded in z around inf 97.1%
cancel-sign-sub-inv97.1%
metadata-eval97.1%
*-lft-identity97.1%
+-commutative97.1%
Simplified97.1%
if -2.2499999999999999e22 < z < 5.9000000000000003e-4Initial program 93.7%
Taylor expanded in z around 0 90.2%
+-commutative90.2%
associate-*r/88.0%
*-commutative88.0%
associate-*r*88.0%
neg-mul-188.0%
distribute-rgt-out93.7%
unsub-neg93.7%
Simplified93.7%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e+42) (* x (/ t z)) (if (<= z 0.00059) (* x (- (/ y z) t)) (/ x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+42) {
tmp = x * (t / z);
} else if (z <= 0.00059) {
tmp = x * ((y / z) - t);
} 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) :: tmp
if (z <= (-2.2d+42)) then
tmp = x * (t / z)
else if (z <= 0.00059d0) then
tmp = x * ((y / z) - t)
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+42) {
tmp = x * (t / z);
} else if (z <= 0.00059) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+42: tmp = x * (t / z) elif z <= 0.00059: tmp = x * ((y / z) - t) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+42) tmp = Float64(x * Float64(t / z)); elseif (z <= 0.00059) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+42) tmp = x * (t / z); elseif (z <= 0.00059) tmp = x * ((y / z) - t); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+42], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00059], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+42}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 0.00059:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -2.2000000000000001e42Initial program 97.7%
Taylor expanded in z around inf 97.6%
cancel-sign-sub-inv97.6%
metadata-eval97.6%
*-lft-identity97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 70.8%
if -2.2000000000000001e42 < z < 5.9000000000000003e-4Initial program 93.9%
Taylor expanded in z around 0 89.8%
+-commutative89.8%
associate-*r/87.7%
*-commutative87.7%
associate-*r*87.7%
neg-mul-187.7%
distribute-rgt-out93.2%
unsub-neg93.2%
Simplified93.2%
if 5.9000000000000003e-4 < z Initial program 98.1%
Taylor expanded in y around inf 52.4%
associate-/l*60.4%
Simplified60.4%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (<= z -2.25e+22) (* x (/ (+ y t) z)) (if (<= z 0.00059) (* x (- (/ y z) t)) (/ x (/ z (+ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.25e+22) {
tmp = x * ((y + t) / z);
} else if (z <= 0.00059) {
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 <= (-2.25d+22)) then
tmp = x * ((y + t) / z)
else if (z <= 0.00059d0) 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 <= -2.25e+22) {
tmp = x * ((y + t) / z);
} else if (z <= 0.00059) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / (y + t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.25e+22: tmp = x * ((y + t) / z) elif z <= 0.00059: tmp = x * ((y / z) - t) else: tmp = x / (z / (y + t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.25e+22) tmp = Float64(x * Float64(Float64(y + t) / z)); elseif (z <= 0.00059) 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 <= -2.25e+22) tmp = x * ((y + t) / z); elseif (z <= 0.00059) tmp = x * ((y / z) - t); else tmp = x / (z / (y + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.25e+22], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00059], 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 -2.25 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{elif}\;z \leq 0.00059:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\end{array}
\end{array}
if z < -2.2499999999999999e22Initial program 97.8%
Taylor expanded in z around inf 97.8%
cancel-sign-sub-inv97.8%
metadata-eval97.8%
*-lft-identity97.8%
+-commutative97.8%
Simplified97.8%
if -2.2499999999999999e22 < z < 5.9000000000000003e-4Initial program 93.7%
Taylor expanded in z around 0 90.2%
+-commutative90.2%
associate-*r/88.0%
*-commutative88.0%
associate-*r*88.0%
neg-mul-188.0%
distribute-rgt-out93.7%
unsub-neg93.7%
Simplified93.7%
if 5.9000000000000003e-4 < z Initial program 98.1%
Taylor expanded in z around inf 83.4%
associate-/l*96.5%
cancel-sign-sub-inv96.5%
metadata-eval96.5%
*-lft-identity96.5%
+-commutative96.5%
Simplified96.5%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2.25e+22) (* x (+ (/ y z) (/ t z))) (if (<= z 0.00059) (* x (- (/ y z) t)) (/ x (/ z (+ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.25e+22) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 0.00059) {
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 <= (-2.25d+22)) then
tmp = x * ((y / z) + (t / z))
else if (z <= 0.00059d0) 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 <= -2.25e+22) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 0.00059) {
tmp = x * ((y / z) - t);
} else {
tmp = x / (z / (y + t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.25e+22: tmp = x * ((y / z) + (t / z)) elif z <= 0.00059: tmp = x * ((y / z) - t) else: tmp = x / (z / (y + t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.25e+22) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); elseif (z <= 0.00059) 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 <= -2.25e+22) tmp = x * ((y / z) + (t / z)); elseif (z <= 0.00059) tmp = x * ((y / z) - t); else tmp = x / (z / (y + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.25e+22], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00059], 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 -2.25 \cdot 10^{+22}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 0.00059:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\end{array}
\end{array}
if z < -2.2499999999999999e22Initial program 97.8%
Taylor expanded in z around inf 97.8%
associate-*r/97.8%
neg-mul-197.8%
Simplified97.8%
if -2.2499999999999999e22 < z < 5.9000000000000003e-4Initial program 93.7%
Taylor expanded in z around 0 90.2%
+-commutative90.2%
associate-*r/88.0%
*-commutative88.0%
associate-*r*88.0%
neg-mul-188.0%
distribute-rgt-out93.7%
unsub-neg93.7%
Simplified93.7%
if 5.9000000000000003e-4 < z Initial program 98.1%
Taylor expanded in z around inf 83.4%
associate-/l*96.5%
cancel-sign-sub-inv96.5%
metadata-eval96.5%
*-lft-identity96.5%
+-commutative96.5%
Simplified96.5%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.5e-35) (not (<= z 0.00059))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-35) || !(z <= 0.00059)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
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 <= (-3.5d-35)) .or. (.not. (z <= 0.00059d0))) then
tmp = t * (x / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-35) || !(z <= 0.00059)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.5e-35) or not (z <= 0.00059): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.5e-35) || !(z <= 0.00059)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.5e-35) || ~((z <= 0.00059))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e-35], N[Not[LessEqual[z, 0.00059]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -3.49999999999999996e-35 or 5.9000000000000003e-4 < z Initial program 98.0%
Taylor expanded in z around inf 87.3%
associate-/l*96.8%
cancel-sign-sub-inv96.8%
metadata-eval96.8%
*-lft-identity96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 54.9%
associate-*r/51.9%
Simplified51.9%
if -3.49999999999999996e-35 < z < 5.9000000000000003e-4Initial program 93.5%
Taylor expanded in z around 0 90.6%
+-commutative90.6%
associate-*r/88.4%
*-commutative88.4%
associate-*r*88.4%
neg-mul-188.4%
distribute-rgt-out93.5%
unsub-neg93.5%
Simplified93.5%
Taylor expanded in y around 0 35.2%
mul-1-neg35.2%
distribute-lft-neg-out35.2%
*-commutative35.2%
Simplified35.2%
Final simplification44.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.5e-35) (not (<= z 0.00059))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-35) || !(z <= 0.00059)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
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 <= (-3.5d-35)) .or. (.not. (z <= 0.00059d0))) then
tmp = x * (t / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-35) || !(z <= 0.00059)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.5e-35) or not (z <= 0.00059): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.5e-35) || !(z <= 0.00059)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.5e-35) || ~((z <= 0.00059))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e-35], N[Not[LessEqual[z, 0.00059]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-35} \lor \neg \left(z \leq 0.00059\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -3.49999999999999996e-35 or 5.9000000000000003e-4 < z Initial program 98.0%
Taylor expanded in z around inf 97.2%
cancel-sign-sub-inv97.2%
metadata-eval97.2%
*-lft-identity97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 60.2%
if -3.49999999999999996e-35 < z < 5.9000000000000003e-4Initial program 93.5%
Taylor expanded in z around 0 90.6%
+-commutative90.6%
associate-*r/88.4%
*-commutative88.4%
associate-*r*88.4%
neg-mul-188.4%
distribute-rgt-out93.5%
unsub-neg93.5%
Simplified93.5%
Taylor expanded in y around 0 35.2%
mul-1-neg35.2%
distribute-lft-neg-out35.2%
*-commutative35.2%
Simplified35.2%
Final simplification48.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.9e+145) (not (<= t 3e+131))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.9e+145) || !(t <= 3e+131)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
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 ((t <= (-3.9d+145)) .or. (.not. (t <= 3d+131))) then
tmp = x * (t / z)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.9e+145) || !(t <= 3e+131)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.9e+145) or not (t <= 3e+131): tmp = x * (t / z) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.9e+145) || !(t <= 3e+131)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.9e+145) || ~((t <= 3e+131))) tmp = x * (t / z); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.9e+145], N[Not[LessEqual[t, 3e+131]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+145} \lor \neg \left(t \leq 3 \cdot 10^{+131}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -3.8999999999999998e145 or 3.0000000000000001e131 < t Initial program 98.2%
Taylor expanded in z around inf 73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in t around inf 62.1%
if -3.8999999999999998e145 < t < 3.0000000000000001e131Initial program 95.1%
Taylor expanded in y around inf 70.4%
associate-*r/72.0%
Simplified72.0%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1e+147) (not (<= t 1.5e+130))) (/ x (/ z t)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1e+147) || !(t <= 1.5e+130)) {
tmp = x / (z / t);
} else {
tmp = (y / z) * x;
}
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 ((t <= (-1d+147)) .or. (.not. (t <= 1.5d+130))) then
tmp = x / (z / t)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1e+147) || !(t <= 1.5e+130)) {
tmp = x / (z / t);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1e+147) or not (t <= 1.5e+130): tmp = x / (z / t) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1e+147) || !(t <= 1.5e+130)) tmp = Float64(x / Float64(z / t)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1e+147) || ~((t <= 1.5e+130))) tmp = x / (z / t); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1e+147], N[Not[LessEqual[t, 1.5e+130]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+147} \lor \neg \left(t \leq 1.5 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -9.9999999999999998e146 or 1.5e130 < t Initial program 98.2%
Taylor expanded in z around inf 60.7%
associate-/l*73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in t around inf 62.2%
if -9.9999999999999998e146 < t < 1.5e130Initial program 95.1%
Taylor expanded in y around inf 70.4%
associate-*r/72.0%
Simplified72.0%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (* t (- x)))
double code(double x, double y, double z, double t) {
return t * -x;
}
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 = t * -x
end function
public static double code(double x, double y, double z, double t) {
return t * -x;
}
def code(x, y, z, t): return t * -x
function code(x, y, z, t) return Float64(t * Float64(-x)) end
function tmp = code(x, y, z, t) tmp = t * -x; end
code[x_, y_, z_, t_] := N[(t * (-x)), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(-x\right)
\end{array}
Initial program 95.9%
Taylor expanded in z around 0 59.3%
+-commutative59.3%
associate-*r/59.3%
*-commutative59.3%
associate-*r*59.3%
neg-mul-159.3%
distribute-rgt-out62.1%
unsub-neg62.1%
Simplified62.1%
Taylor expanded in y around 0 22.5%
mul-1-neg22.5%
distribute-lft-neg-out22.5%
*-commutative22.5%
Simplified22.5%
Final simplification22.5%
(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 2023320
(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)))))