
(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 11 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 1e+265) (* t_1 x) (- (/ (* y x) z) (* t 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 <= 1e+265) {
tmp = t_1 * x;
} else {
tmp = ((y * x) / z) - (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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 1d+265) then
tmp = t_1 * x
else
tmp = ((y * x) / z) - (t * x)
end if
code = tmp
end function
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 <= 1e+265) {
tmp = t_1 * x;
} else {
tmp = ((y * x) / z) - (t * x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 1e+265: tmp = t_1 * x else: tmp = ((y * x) / z) - (t * 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 <= 1e+265) tmp = Float64(t_1 * x); else tmp = Float64(Float64(Float64(y * x) / z) - Float64(t * 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 <= 1e+265) tmp = t_1 * x; else tmp = ((y * x) / z) - (t * 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, 1e+265], N[(t$95$1 * x), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq 10^{+265}:\\
\;\;\;\;t_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z} - t \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 1.00000000000000007e265Initial program 99.0%
if 1.00000000000000007e265 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 73.1%
Taylor expanded in z around 0 99.8%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z))))) (if (<= t_1 2e+294) (* t_1 x) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= 2e+294) {
tmp = t_1 * x;
} else {
tmp = y * (x / 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) :: t_1
real(8) :: tmp
t_1 = (y / z) - (t / (1.0d0 - z))
if (t_1 <= 2d+294) then
tmp = t_1 * x
else
tmp = y * (x / z)
end if
code = tmp
end function
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 <= 2e+294) {
tmp = t_1 * x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= 2e+294: tmp = t_1 * x else: tmp = y * (x / z) 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 <= 2e+294) tmp = Float64(t_1 * x); else tmp = Float64(y * Float64(x / z)); 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 <= 2e+294) tmp = t_1 * x; else tmp = y * (x / z); 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, 2e+294], N[(t$95$1 * x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;t_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 2.00000000000000013e294Initial program 99.0%
if 2.00000000000000013e294 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 64.3%
Taylor expanded in y around inf 99.9%
associate-/l*64.3%
Simplified64.3%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z y))))
(if (<= z -4.9e+17)
t_1
(if (<= z 4100000000.0)
(* x (- (/ y z) t))
(if (or (<= z 1.65e+239) (not (<= z 6.8e+292))) (* x (/ t z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / y);
double tmp;
if (z <= -4.9e+17) {
tmp = t_1;
} else if (z <= 4100000000.0) {
tmp = x * ((y / z) - t);
} else if ((z <= 1.65e+239) || !(z <= 6.8e+292)) {
tmp = x * (t / 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) :: tmp
t_1 = x / (z / y)
if (z <= (-4.9d+17)) then
tmp = t_1
else if (z <= 4100000000.0d0) then
tmp = x * ((y / z) - t)
else if ((z <= 1.65d+239) .or. (.not. (z <= 6.8d+292))) then
tmp = x * (t / 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 / (z / y);
double tmp;
if (z <= -4.9e+17) {
tmp = t_1;
} else if (z <= 4100000000.0) {
tmp = x * ((y / z) - t);
} else if ((z <= 1.65e+239) || !(z <= 6.8e+292)) {
tmp = x * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / y) tmp = 0 if z <= -4.9e+17: tmp = t_1 elif z <= 4100000000.0: tmp = x * ((y / z) - t) elif (z <= 1.65e+239) or not (z <= 6.8e+292): tmp = x * (t / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / y)) tmp = 0.0 if (z <= -4.9e+17) tmp = t_1; elseif (z <= 4100000000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif ((z <= 1.65e+239) || !(z <= 6.8e+292)) tmp = Float64(x * Float64(t / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / y); tmp = 0.0; if (z <= -4.9e+17) tmp = t_1; elseif (z <= 4100000000.0) tmp = x * ((y / z) - t); elseif ((z <= 1.65e+239) || ~((z <= 6.8e+292))) tmp = x * (t / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+17], t$95$1, If[LessEqual[z, 4100000000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.65e+239], N[Not[LessEqual[z, 6.8e+292]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y}}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4100000000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+239} \lor \neg \left(z \leq 6.8 \cdot 10^{+292}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.9e17 or 1.6499999999999999e239 < z < 6.8000000000000003e292Initial program 99.7%
Taylor expanded in y around inf 54.6%
associate-/l*63.7%
Simplified63.7%
if -4.9e17 < z < 4.1e9Initial program 93.2%
Taylor expanded in z around 0 92.6%
+-commutative92.6%
mul-1-neg92.6%
unsub-neg92.6%
*-commutative92.6%
associate-*r/89.1%
distribute-lft-out--92.0%
Simplified92.0%
if 4.1e9 < z < 1.6499999999999999e239 or 6.8000000000000003e292 < z Initial program 99.8%
clear-num99.8%
associate-/r/99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 89.1%
*-commutative89.1%
sub-neg89.1%
mul-1-neg89.1%
remove-double-neg89.1%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 60.0%
associate-/l*59.7%
associate-/r/68.7%
Simplified68.7%
Final simplification80.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y z) x)))
(if (<= y -3e-57)
t_1
(if (<= y -7.8e-264)
(* t (/ x z))
(if (<= y 1.85e-110) (* t (- x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -3e-57) {
tmp = t_1;
} else if (y <= -7.8e-264) {
tmp = t * (x / z);
} else if (y <= 1.85e-110) {
tmp = t * -x;
} 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 = (y / z) * x
if (y <= (-3d-57)) then
tmp = t_1
else if (y <= (-7.8d-264)) then
tmp = t * (x / z)
else if (y <= 1.85d-110) then
tmp = t * -x
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 = (y / z) * x;
double tmp;
if (y <= -3e-57) {
tmp = t_1;
} else if (y <= -7.8e-264) {
tmp = t * (x / z);
} else if (y <= 1.85e-110) {
tmp = t * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) * x tmp = 0 if y <= -3e-57: tmp = t_1 elif y <= -7.8e-264: tmp = t * (x / z) elif y <= 1.85e-110: tmp = t * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (y <= -3e-57) tmp = t_1; elseif (y <= -7.8e-264) tmp = Float64(t * Float64(x / z)); elseif (y <= 1.85e-110) tmp = Float64(t * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) * x; tmp = 0.0; if (y <= -3e-57) tmp = t_1; elseif (y <= -7.8e-264) tmp = t * (x / z); elseif (y <= 1.85e-110) tmp = t * -x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -3e-57], t$95$1, If[LessEqual[y, -7.8e-264], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-110], N[(t * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -3 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-264}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-110}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.00000000000000001e-57 or 1.85000000000000008e-110 < y Initial program 94.1%
Taylor expanded in y around inf 79.3%
associate-*r/77.8%
Simplified77.8%
if -3.00000000000000001e-57 < y < -7.7999999999999997e-264Initial program 99.9%
Taylor expanded in z around inf 69.0%
associate-/l*79.4%
neg-mul-179.4%
Simplified79.4%
Taylor expanded in y around 0 62.3%
associate-*r/64.8%
Simplified64.8%
if -7.7999999999999997e-264 < y < 1.85000000000000008e-110Initial program 99.9%
Taylor expanded in z around 0 67.9%
+-commutative67.9%
mul-1-neg67.9%
unsub-neg67.9%
*-commutative67.9%
associate-*r/69.7%
distribute-lft-out--69.7%
Simplified69.7%
Taylor expanded in y around 0 57.4%
associate-*r*57.4%
mul-1-neg57.4%
Simplified57.4%
Final simplification71.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y z) x)))
(if (<= y -2.8e-46)
t_1
(if (<= y 9.8e-183)
(* x (/ t z))
(if (<= y 2.05e-110) (* t (- x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) * x;
double tmp;
if (y <= -2.8e-46) {
tmp = t_1;
} else if (y <= 9.8e-183) {
tmp = x * (t / z);
} else if (y <= 2.05e-110) {
tmp = t * -x;
} 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 = (y / z) * x
if (y <= (-2.8d-46)) then
tmp = t_1
else if (y <= 9.8d-183) then
tmp = x * (t / z)
else if (y <= 2.05d-110) then
tmp = t * -x
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 = (y / z) * x;
double tmp;
if (y <= -2.8e-46) {
tmp = t_1;
} else if (y <= 9.8e-183) {
tmp = x * (t / z);
} else if (y <= 2.05e-110) {
tmp = t * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) * x tmp = 0 if y <= -2.8e-46: tmp = t_1 elif y <= 9.8e-183: tmp = x * (t / z) elif y <= 2.05e-110: tmp = t * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) * x) tmp = 0.0 if (y <= -2.8e-46) tmp = t_1; elseif (y <= 9.8e-183) tmp = Float64(x * Float64(t / z)); elseif (y <= 2.05e-110) tmp = Float64(t * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) * x; tmp = 0.0; if (y <= -2.8e-46) tmp = t_1; elseif (y <= 9.8e-183) tmp = x * (t / z); elseif (y <= 2.05e-110) tmp = t * -x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -2.8e-46], t$95$1, If[LessEqual[y, 9.8e-183], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-110], N[(t * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} \cdot x\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-110}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.7999999999999998e-46 or 2.04999999999999991e-110 < y Initial program 93.8%
Taylor expanded in y around inf 80.7%
associate-*r/79.1%
Simplified79.1%
if -2.7999999999999998e-46 < y < 9.799999999999999e-183Initial program 99.9%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 64.4%
*-commutative64.4%
sub-neg64.4%
mul-1-neg64.4%
remove-double-neg64.4%
associate-*l/69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in y around 0 58.8%
associate-/l*56.3%
associate-/r/62.5%
Simplified62.5%
if 9.799999999999999e-183 < y < 2.04999999999999991e-110Initial program 99.9%
Taylor expanded in z around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
associate-*r/79.6%
distribute-lft-out--79.6%
Simplified79.6%
Taylor expanded in y around 0 64.8%
associate-*r*64.8%
mul-1-neg64.8%
Simplified64.8%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ x z))))
(if (<= y -2.7e-45)
t_1
(if (<= y 3.7e-183) (* x (/ t z)) (if (<= y 2.8e-107) (* t (- x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double tmp;
if (y <= -2.7e-45) {
tmp = t_1;
} else if (y <= 3.7e-183) {
tmp = x * (t / z);
} else if (y <= 2.8e-107) {
tmp = t * -x;
} 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 = y * (x / z)
if (y <= (-2.7d-45)) then
tmp = t_1
else if (y <= 3.7d-183) then
tmp = x * (t / z)
else if (y <= 2.8d-107) then
tmp = t * -x
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 = y * (x / z);
double tmp;
if (y <= -2.7e-45) {
tmp = t_1;
} else if (y <= 3.7e-183) {
tmp = x * (t / z);
} else if (y <= 2.8e-107) {
tmp = t * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x / z) tmp = 0 if y <= -2.7e-45: tmp = t_1 elif y <= 3.7e-183: tmp = x * (t / z) elif y <= 2.8e-107: tmp = t * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -2.7e-45) tmp = t_1; elseif (y <= 3.7e-183) tmp = Float64(x * Float64(t / z)); elseif (y <= 2.8e-107) tmp = Float64(t * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x / z); tmp = 0.0; if (y <= -2.7e-45) tmp = t_1; elseif (y <= 3.7e-183) tmp = x * (t / z); elseif (y <= 2.8e-107) tmp = t * -x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-45], t$95$1, If[LessEqual[y, 3.7e-183], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-107], N[(t * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-107}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.69999999999999985e-45 or 2.7999999999999999e-107 < y Initial program 93.8%
Taylor expanded in y around inf 80.7%
associate-/l*79.1%
Simplified79.1%
associate-/r/79.9%
Applied egg-rr79.9%
if -2.69999999999999985e-45 < y < 3.6999999999999999e-183Initial program 99.9%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 64.4%
*-commutative64.4%
sub-neg64.4%
mul-1-neg64.4%
remove-double-neg64.4%
associate-*l/69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in y around 0 58.8%
associate-/l*56.3%
associate-/r/62.5%
Simplified62.5%
if 3.6999999999999999e-183 < y < 2.7999999999999999e-107Initial program 99.9%
Taylor expanded in z around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
associate-*r/79.6%
distribute-lft-out--79.6%
Simplified79.6%
Taylor expanded in y around 0 64.8%
associate-*r*64.8%
mul-1-neg64.8%
Simplified64.8%
Final simplification73.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.5e-45)
(* y (/ x z))
(if (<= y 2.7e-186)
(* x (/ t z))
(if (<= y 3.1e-111) (* t (- x)) (/ (* y x) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-45) {
tmp = y * (x / z);
} else if (y <= 2.7e-186) {
tmp = x * (t / z);
} else if (y <= 3.1e-111) {
tmp = t * -x;
} else {
tmp = (y * x) / 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 (y <= (-3.5d-45)) then
tmp = y * (x / z)
else if (y <= 2.7d-186) then
tmp = x * (t / z)
else if (y <= 3.1d-111) then
tmp = t * -x
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-45) {
tmp = y * (x / z);
} else if (y <= 2.7e-186) {
tmp = x * (t / z);
} else if (y <= 3.1e-111) {
tmp = t * -x;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-45: tmp = y * (x / z) elif y <= 2.7e-186: tmp = x * (t / z) elif y <= 3.1e-111: tmp = t * -x else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-45) tmp = Float64(y * Float64(x / z)); elseif (y <= 2.7e-186) tmp = Float64(x * Float64(t / z)); elseif (y <= 3.1e-111) tmp = Float64(t * Float64(-x)); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-45) tmp = y * (x / z); elseif (y <= 2.7e-186) tmp = x * (t / z); elseif (y <= 3.1e-111) tmp = t * -x; else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-45], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-186], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-111], N[(t * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-45}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-186}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-111}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -3.5e-45Initial program 95.1%
Taylor expanded in y around inf 76.9%
associate-/l*79.8%
Simplified79.8%
associate-/r/80.2%
Applied egg-rr80.2%
if -3.5e-45 < y < 2.6999999999999999e-186Initial program 99.9%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 64.4%
*-commutative64.4%
sub-neg64.4%
mul-1-neg64.4%
remove-double-neg64.4%
associate-*l/69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in y around 0 58.8%
associate-/l*56.3%
associate-/r/62.5%
Simplified62.5%
if 2.6999999999999999e-186 < y < 3.10000000000000014e-111Initial program 99.9%
Taylor expanded in z around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
associate-*r/79.6%
distribute-lft-out--79.6%
Simplified79.6%
Taylor expanded in y around 0 64.8%
associate-*r*64.8%
mul-1-neg64.8%
Simplified64.8%
if 3.10000000000000014e-111 < y Initial program 93.0%
Taylor expanded in y around inf 83.1%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.09))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 0.09)) {
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 <= (-1.0d0)) .or. (.not. (z <= 0.09d0))) 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 <= -1.0) || !(z <= 0.09)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 0.09): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.09)) 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 <= -1.0) || ~((z <= 0.09))) 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, -1.0], N[Not[LessEqual[z, 0.09]], $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 -1 \lor \neg \left(z \leq 0.09\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1 or 0.089999999999999997 < z Initial program 99.7%
clear-num99.7%
associate-/r/99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 88.1%
*-commutative88.1%
sub-neg88.1%
mul-1-neg88.1%
remove-double-neg88.1%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
if -1 < z < 0.089999999999999997Initial program 92.8%
Taylor expanded in z around 0 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
*-commutative93.0%
associate-*r/89.3%
distribute-lft-out--92.3%
Simplified92.3%
Final simplification95.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.1e-45) (* y (/ x z)) (if (<= y 8.5e-102) (* x (/ t (+ z -1.0))) (/ (* y x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-45) {
tmp = y * (x / z);
} else if (y <= 8.5e-102) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y * x) / 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 (y <= (-1.1d-45)) then
tmp = y * (x / z)
else if (y <= 8.5d-102) then
tmp = x * (t / (z + (-1.0d0)))
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-45) {
tmp = y * (x / z);
} else if (y <= 8.5e-102) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e-45: tmp = y * (x / z) elif y <= 8.5e-102: tmp = x * (t / (z + -1.0)) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-45) tmp = Float64(y * Float64(x / z)); elseif (y <= 8.5e-102) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e-45) tmp = y * (x / z); elseif (y <= 8.5e-102) tmp = x * (t / (z + -1.0)); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-45], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e-102], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-45}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-102}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -1.09999999999999997e-45Initial program 95.1%
Taylor expanded in y around inf 76.9%
associate-/l*79.8%
Simplified79.8%
associate-/r/80.2%
Applied egg-rr80.2%
if -1.09999999999999997e-45 < y < 8.49999999999999973e-102Initial program 99.9%
Taylor expanded in y around 0 78.5%
associate-*r/78.5%
associate-*r*78.5%
neg-mul-178.5%
associate-*l/83.3%
*-commutative83.3%
distribute-frac-neg83.3%
neg-mul-183.3%
metadata-eval83.3%
times-frac83.3%
*-lft-identity83.3%
neg-mul-183.3%
neg-sub083.3%
associate--r-83.3%
metadata-eval83.3%
Simplified83.3%
if 8.49999999999999973e-102 < y Initial program 92.9%
Taylor expanded in y around inf 83.7%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.068) (not (<= z 0.09))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.068) || !(z <= 0.09)) {
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 <= (-0.068d0)) .or. (.not. (z <= 0.09d0))) 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 <= -0.068) || !(z <= 0.09)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.068) or not (z <= 0.09): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.068) || !(z <= 0.09)) 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 <= -0.068) || ~((z <= 0.09))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.068], N[Not[LessEqual[z, 0.09]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.068 \lor \neg \left(z \leq 0.09\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -0.068000000000000005 or 0.089999999999999997 < z Initial program 99.7%
Taylor expanded in z around inf 88.3%
associate-/l*99.6%
neg-mul-199.6%
Simplified99.6%
Taylor expanded in y around 0 49.5%
associate-*r/46.3%
Simplified46.3%
if -0.068000000000000005 < z < 0.089999999999999997Initial program 92.7%
Taylor expanded in z around 0 92.9%
+-commutative92.9%
mul-1-neg92.9%
unsub-neg92.9%
*-commutative92.9%
associate-*r/89.2%
distribute-lft-out--92.2%
Simplified92.2%
Taylor expanded in y around 0 36.2%
associate-*r*36.2%
mul-1-neg36.2%
Simplified36.2%
Final simplification41.1%
(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 96.1%
Taylor expanded in z around 0 66.0%
+-commutative66.0%
mul-1-neg66.0%
unsub-neg66.0%
*-commutative66.0%
associate-*r/65.5%
distribute-lft-out--67.1%
Simplified67.1%
Taylor expanded in y around 0 24.9%
associate-*r*24.9%
mul-1-neg24.9%
Simplified24.9%
Final simplification24.9%
(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 2023290
(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)))))