
(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 (* x (+ (/ y z) (/ t (+ z -1.0)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) + (t / (z + -1.0)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) + (t / (z + (-1.0d0))))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) + (t / (z + -1.0)));
}
def code(x, y, z, t): return x * ((y / z) + (t / (z + -1.0)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) + (t / (z + -1.0))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} + \frac{t}{z + -1}\right)
\end{array}
Initial program 96.3%
Final simplification96.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -126.0) (not (<= z 3e-6))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -126.0) || !(z <= 3e-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 <= (-126.0d0)) .or. (.not. (z <= 3d-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 <= -126.0) || !(z <= 3e-6)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -126.0) or not (z <= 3e-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 <= -126.0) || !(z <= 3e-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 <= -126.0) || ~((z <= 3e-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, -126.0], N[Not[LessEqual[z, 3e-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 -126 \lor \neg \left(z \leq 3 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -126 or 3.0000000000000001e-6 < z Initial program 98.6%
Taylor expanded in z around inf 85.8%
associate-/l*98.5%
cancel-sign-sub-inv98.5%
metadata-eval98.5%
*-lft-identity98.5%
+-commutative98.5%
Simplified98.5%
if -126 < z < 3.0000000000000001e-6Initial program 93.6%
Taylor expanded in z around 0 92.1%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e+74) (not (<= t 4.8e+105))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e+74) || !(t <= 4.8e+105)) {
tmp = x * (t / (z + -1.0));
} 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 ((t <= (-5d+74)) .or. (.not. (t <= 4.8d+105))) then
tmp = x * (t / (z + (-1.0d0)))
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 ((t <= -5e+74) || !(t <= 4.8e+105)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5e+74) or not (t <= 4.8e+105): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5e+74) || !(t <= 4.8e+105)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5e+74) || ~((t <= 4.8e+105))) tmp = x * (t / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5e+74], N[Not[LessEqual[t, 4.8e+105]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+74} \lor \neg \left(t \leq 4.8 \cdot 10^{+105}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -4.99999999999999963e74 or 4.7999999999999995e105 < t Initial program 98.6%
Taylor expanded in y around 0 75.6%
mul-1-neg75.6%
distribute-neg-frac275.6%
neg-sub075.6%
associate--r-75.6%
metadata-eval75.6%
Simplified75.6%
if -4.99999999999999963e74 < t < 4.7999999999999995e105Initial program 95.2%
Taylor expanded in y around inf 77.5%
associate-*r/78.9%
Simplified78.9%
clear-num78.7%
un-div-inv79.5%
Applied egg-rr79.5%
Final simplification78.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.42e+19) (not (<= z 4.6e+54))) (* x (/ t z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.42e+19) || !(z <= 4.6e+54)) {
tmp = x * (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 <= (-1.42d+19)) .or. (.not. (z <= 4.6d+54))) then
tmp = x * (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 <= -1.42e+19) || !(z <= 4.6e+54)) {
tmp = x * (t / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.42e+19) or not (z <= 4.6e+54): tmp = x * (t / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.42e+19) || !(z <= 4.6e+54)) tmp = Float64(x * Float64(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 <= -1.42e+19) || ~((z <= 4.6e+54))) tmp = x * (t / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.42e+19], N[Not[LessEqual[z, 4.6e+54]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+19} \lor \neg \left(z \leq 4.6 \cdot 10^{+54}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.42e19 or 4.59999999999999988e54 < z Initial program 98.5%
Taylor expanded in y around 0 62.5%
mul-1-neg62.5%
distribute-neg-frac262.5%
neg-sub062.5%
associate--r-62.5%
metadata-eval62.5%
Simplified62.5%
Taylor expanded in z around inf 62.5%
if -1.42e19 < z < 4.59999999999999988e54Initial program 94.4%
Taylor expanded in z around 0 88.7%
Final simplification76.5%
(FPCore (x y z t) :precision binary64 (if (<= z -126.0) (* x (+ (/ y z) (/ t z))) (if (<= z 3e-6) (* x (- (/ y z) t)) (* x (/ (+ y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -126.0) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 3e-6) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-126.0d0)) then
tmp = x * ((y / z) + (t / z))
else if (z <= 3d-6) then
tmp = x * ((y / z) - t)
else
tmp = x * ((y + t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -126.0) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 3e-6) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -126.0: tmp = x * ((y / z) + (t / z)) elif z <= 3e-6: tmp = x * ((y / z) - t) else: tmp = x * ((y + t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -126.0) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); elseif (z <= 3e-6) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(Float64(y + t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -126.0) tmp = x * ((y / z) + (t / z)); elseif (z <= 3e-6) tmp = x * ((y / z) - t); else tmp = x * ((y + t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -126.0], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-6], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -126:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -126Initial program 99.1%
Taylor expanded in z around inf 98.7%
associate-*r/98.7%
neg-mul-198.7%
Simplified98.7%
if -126 < z < 3.0000000000000001e-6Initial program 93.6%
Taylor expanded in z around 0 92.1%
if 3.0000000000000001e-6 < z Initial program 98.1%
Taylor expanded in z around inf 87.6%
associate-/l*98.1%
cancel-sign-sub-inv98.1%
metadata-eval98.1%
*-lft-identity98.1%
+-commutative98.1%
Simplified98.1%
Final simplification95.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.45e-47) (/ (* x y) z) (if (<= y 2.4e-166) (* t (/ x (+ z -1.0))) (/ x (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e-47) {
tmp = (x * y) / z;
} else if (y <= 2.4e-166) {
tmp = t * (x / (z + -1.0));
} 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 (y <= (-1.45d-47)) then
tmp = (x * y) / z
else if (y <= 2.4d-166) then
tmp = t * (x / (z + (-1.0d0)))
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 (y <= -1.45e-47) {
tmp = (x * y) / z;
} else if (y <= 2.4e-166) {
tmp = t * (x / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.45e-47: tmp = (x * y) / z elif y <= 2.4e-166: tmp = t * (x / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.45e-47) tmp = Float64(Float64(x * y) / z); elseif (y <= 2.4e-166) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.45e-47) tmp = (x * y) / z; elseif (y <= 2.4e-166) tmp = t * (x / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.45e-47], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 2.4e-166], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-47}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-166}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -1.45e-47Initial program 91.0%
Taylor expanded in y around inf 77.8%
if -1.45e-47 < y < 2.3999999999999999e-166Initial program 98.7%
Taylor expanded in y around 0 71.6%
mul-1-neg71.6%
associate-/l*73.0%
distribute-rgt-neg-in73.0%
distribute-neg-frac273.0%
neg-sub073.0%
associate--r-73.0%
metadata-eval73.0%
Simplified73.0%
if 2.3999999999999999e-166 < y Initial program 98.6%
Taylor expanded in y around inf 70.5%
associate-*r/75.2%
Simplified75.2%
clear-num75.2%
un-div-inv75.2%
Applied egg-rr75.2%
Final simplification75.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.5e+75) (not (<= t 1.8e+106))) (* x (/ t z)) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e+75) || !(t <= 1.8e+106)) {
tmp = x * (t / z);
} 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 ((t <= (-1.5d+75)) .or. (.not. (t <= 1.8d+106))) then
tmp = x * (t / z)
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 ((t <= -1.5e+75) || !(t <= 1.8e+106)) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.5e+75) or not (t <= 1.8e+106): tmp = x * (t / z) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.5e+75) || !(t <= 1.8e+106)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.5e+75) || ~((t <= 1.8e+106))) tmp = x * (t / z); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.5e+75], N[Not[LessEqual[t, 1.8e+106]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+75} \lor \neg \left(t \leq 1.8 \cdot 10^{+106}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.5e75 or 1.8e106 < t Initial program 98.6%
Taylor expanded in y around 0 75.6%
mul-1-neg75.6%
distribute-neg-frac275.6%
neg-sub075.6%
associate--r-75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around inf 57.1%
if -1.5e75 < t < 1.8e106Initial program 95.2%
Taylor expanded in y around inf 77.5%
associate-*r/78.9%
Simplified78.9%
clear-num78.7%
un-div-inv79.5%
Applied egg-rr79.5%
Final simplification72.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6.6e+71) (not (<= t 1.65e+107))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.6e+71) || !(t <= 1.65e+107)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-6.6d+71)) .or. (.not. (t <= 1.65d+107))) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -6.6e+71) || !(t <= 1.65e+107)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -6.6e+71) or not (t <= 1.65e+107): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -6.6e+71) || !(t <= 1.65e+107)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -6.6e+71) || ~((t <= 1.65e+107))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -6.6e+71], N[Not[LessEqual[t, 1.65e+107]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{+71} \lor \neg \left(t \leq 1.65 \cdot 10^{+107}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -6.5999999999999996e71 or 1.65000000000000016e107 < t Initial program 98.6%
Taylor expanded in y around 0 75.6%
mul-1-neg75.6%
distribute-neg-frac275.6%
neg-sub075.6%
associate--r-75.6%
metadata-eval75.6%
Simplified75.6%
Taylor expanded in z around inf 57.1%
if -6.5999999999999996e71 < t < 1.65000000000000016e107Initial program 95.2%
Taylor expanded in y around inf 77.5%
associate-*r/78.9%
Simplified78.9%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -17000000000000.0) (not (<= z 0.00135))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -17000000000000.0) || !(z <= 0.00135)) {
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 <= (-17000000000000.0d0)) .or. (.not. (z <= 0.00135d0))) 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 <= -17000000000000.0) || !(z <= 0.00135)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -17000000000000.0) or not (z <= 0.00135): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -17000000000000.0) || !(z <= 0.00135)) 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 <= -17000000000000.0) || ~((z <= 0.00135))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -17000000000000.0], N[Not[LessEqual[z, 0.00135]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17000000000000 \lor \neg \left(z \leq 0.00135\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1.7e13 or 0.0013500000000000001 < z Initial program 98.6%
Taylor expanded in y around 0 60.4%
mul-1-neg60.4%
distribute-neg-frac260.4%
neg-sub060.4%
associate--r-60.4%
metadata-eval60.4%
Simplified60.4%
Taylor expanded in z around inf 60.4%
if -1.7e13 < z < 0.0013500000000000001Initial program 93.8%
Taylor expanded in y around 0 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
neg-sub029.3%
associate--r-29.3%
metadata-eval29.3%
Simplified29.3%
Taylor expanded in z around 0 27.9%
*-commutative27.9%
neg-mul-127.9%
distribute-rgt-neg-in27.9%
Simplified27.9%
Final simplification44.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -17000000000000.0) (not (<= z 0.00135))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -17000000000000.0) || !(z <= 0.00135)) {
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 <= (-17000000000000.0d0)) .or. (.not. (z <= 0.00135d0))) 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 <= -17000000000000.0) || !(z <= 0.00135)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -17000000000000.0) or not (z <= 0.00135): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -17000000000000.0) || !(z <= 0.00135)) 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 <= -17000000000000.0) || ~((z <= 0.00135))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -17000000000000.0], N[Not[LessEqual[z, 0.00135]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17000000000000 \lor \neg \left(z \leq 0.00135\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1.7e13 or 0.0013500000000000001 < z Initial program 98.6%
Taylor expanded in y around 0 60.4%
mul-1-neg60.4%
distribute-neg-frac260.4%
neg-sub060.4%
associate--r-60.4%
metadata-eval60.4%
Simplified60.4%
Taylor expanded in z around inf 50.4%
associate-/l*53.9%
Simplified53.9%
if -1.7e13 < z < 0.0013500000000000001Initial program 93.8%
Taylor expanded in y around 0 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
neg-sub029.3%
associate--r-29.3%
metadata-eval29.3%
Simplified29.3%
Taylor expanded in z around 0 27.9%
*-commutative27.9%
neg-mul-127.9%
distribute-rgt-neg-in27.9%
Simplified27.9%
Final simplification41.3%
(FPCore (x y z t) :precision binary64 (if (<= z 0.00135) (* t (- x)) (* x t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.00135) {
tmp = t * -x;
} 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 <= 0.00135d0) then
tmp = t * -x
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 <= 0.00135) {
tmp = t * -x;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 0.00135: tmp = t * -x else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 0.00135) tmp = Float64(t * Float64(-x)); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 0.00135) tmp = t * -x; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 0.00135], N[(t * (-x)), $MachinePrecision], N[(x * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.00135:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if z < 0.0013500000000000001Initial program 95.7%
Taylor expanded in y around 0 41.2%
mul-1-neg41.2%
distribute-neg-frac241.2%
neg-sub041.2%
associate--r-41.2%
metadata-eval41.2%
Simplified41.2%
Taylor expanded in z around 0 21.8%
*-commutative21.8%
neg-mul-121.8%
distribute-rgt-neg-in21.8%
Simplified21.8%
if 0.0013500000000000001 < z Initial program 98.1%
Taylor expanded in y around 0 58.8%
mul-1-neg58.8%
distribute-neg-frac258.8%
neg-sub058.8%
associate--r-58.8%
metadata-eval58.8%
Simplified58.8%
Taylor expanded in z around 0 12.9%
*-commutative12.9%
neg-mul-112.9%
distribute-rgt-neg-in12.9%
Simplified12.9%
neg-sub012.9%
sub-neg12.9%
add-sqr-sqrt6.8%
sqrt-unprod19.0%
sqr-neg19.0%
sqrt-unprod10.0%
add-sqr-sqrt21.7%
Applied egg-rr21.7%
+-lft-identity21.7%
Simplified21.7%
Final simplification21.8%
(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 * 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 t
\end{array}
Initial program 96.3%
Taylor expanded in y around 0 45.3%
mul-1-neg45.3%
distribute-neg-frac245.3%
neg-sub045.3%
associate--r-45.3%
metadata-eval45.3%
Simplified45.3%
Taylor expanded in z around 0 19.7%
*-commutative19.7%
neg-mul-119.7%
distribute-rgt-neg-in19.7%
Simplified19.7%
neg-sub019.7%
sub-neg19.7%
add-sqr-sqrt10.0%
sqrt-unprod16.6%
sqr-neg16.6%
sqrt-unprod6.2%
add-sqr-sqrt10.8%
Applied egg-rr10.8%
+-lft-identity10.8%
Simplified10.8%
(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 2024139
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))