
(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 9 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 (+ z -1.0))))) (if (<= t_1 3.2e+284) (* t_1 x) (* y (/ x z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= 3.2e+284) {
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 / (z + (-1.0d0)))
if (t_1 <= 3.2d+284) 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 / (z + -1.0));
double tmp;
if (t_1 <= 3.2e+284) {
tmp = t_1 * x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= 3.2e+284: 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(z + -1.0))) tmp = 0.0 if (t_1 <= 3.2e+284) 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 / (z + -1.0)); tmp = 0.0; if (t_1 <= 3.2e+284) 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[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 3.2e+284], 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}{z + -1}\\
\mathbf{if}\;t\_1 \leq 3.2 \cdot 10^{+284}:\\
\;\;\;\;t\_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 3.19999999999999986e284Initial program 96.9%
if 3.19999999999999986e284 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 71.8%
Taylor expanded in y around inf 99.9%
associate-*r/71.8%
Simplified71.8%
clear-num71.9%
un-div-inv71.9%
Applied egg-rr71.9%
associate-/r/100.0%
Applied egg-rr100.0%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -500000000000.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -500000000000.0) || !(z <= 1.0)) {
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 <= (-500000000000.0d0)) .or. (.not. (z <= 1.0d0))) 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 <= -500000000000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -500000000000.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -500000000000.0) || !(z <= 1.0)) 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 <= -500000000000.0) || ~((z <= 1.0))) 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, -500000000000.0], N[Not[LessEqual[z, 1.0]], $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 -500000000000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -5e11 or 1 < z Initial program 95.8%
Taylor expanded in z around inf 89.2%
associate-/l*95.0%
cancel-sign-sub-inv95.0%
metadata-eval95.0%
*-lft-identity95.0%
+-commutative95.0%
Simplified95.0%
if -5e11 < z < 1Initial program 93.5%
Taylor expanded in z around 0 91.8%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.15e-144) (* y (/ x z)) (if (<= y 7e-43) (* x (/ t (+ z -1.0))) (* (/ y z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e-144) {
tmp = y * (x / z);
} else if (y <= 7e-43) {
tmp = x * (t / (z + -1.0));
} 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 (y <= (-1.15d-144)) then
tmp = y * (x / z)
else if (y <= 7d-43) then
tmp = x * (t / (z + (-1.0d0)))
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 (y <= -1.15e-144) {
tmp = y * (x / z);
} else if (y <= 7e-43) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e-144: tmp = y * (x / z) elif y <= 7e-43: tmp = x * (t / (z + -1.0)) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e-144) tmp = Float64(y * Float64(x / z)); elseif (y <= 7e-43) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e-144) tmp = y * (x / z); elseif (y <= 7e-43) tmp = x * (t / (z + -1.0)); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-43], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if y < -1.15e-144Initial program 91.1%
Taylor expanded in y around inf 79.6%
associate-*r/75.5%
Simplified75.5%
clear-num75.4%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/79.7%
Applied egg-rr79.7%
if -1.15e-144 < y < 6.99999999999999994e-43Initial program 95.6%
Taylor expanded in y around 0 78.6%
mul-1-neg78.6%
distribute-neg-frac278.6%
neg-sub078.6%
associate--r-78.6%
metadata-eval78.6%
Simplified78.6%
if 6.99999999999999994e-43 < y Initial program 97.3%
Taylor expanded in y around inf 77.3%
associate-*r/78.6%
Simplified78.6%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.15e-144) (* y (/ x z)) (if (<= y 7.6e-63) (* t (/ x (+ z -1.0))) (* (/ y z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e-144) {
tmp = y * (x / z);
} else if (y <= 7.6e-63) {
tmp = t * (x / (z + -1.0));
} 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 (y <= (-1.15d-144)) then
tmp = y * (x / z)
else if (y <= 7.6d-63) then
tmp = t * (x / (z + (-1.0d0)))
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 (y <= -1.15e-144) {
tmp = y * (x / z);
} else if (y <= 7.6e-63) {
tmp = t * (x / (z + -1.0));
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e-144: tmp = y * (x / z) elif y <= 7.6e-63: tmp = t * (x / (z + -1.0)) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e-144) tmp = Float64(y * Float64(x / z)); elseif (y <= 7.6e-63) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e-144) tmp = y * (x / z); elseif (y <= 7.6e-63) tmp = t * (x / (z + -1.0)); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e-63], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-63}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if y < -1.15e-144Initial program 91.1%
Taylor expanded in y around inf 79.6%
associate-*r/75.5%
Simplified75.5%
clear-num75.4%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/79.7%
Applied egg-rr79.7%
if -1.15e-144 < y < 7.60000000000000034e-63Initial program 95.4%
Taylor expanded in y around 0 76.9%
mul-1-neg76.9%
associate-/l*75.9%
distribute-rgt-neg-in75.9%
distribute-neg-frac275.9%
neg-sub075.9%
associate--r-75.9%
metadata-eval75.9%
Simplified75.9%
if 7.60000000000000034e-63 < y Initial program 97.5%
Taylor expanded in y around inf 74.6%
associate-*r/76.4%
Simplified76.4%
Final simplification77.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -235000.0) (not (<= z 3.7))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -235000.0) || !(z <= 3.7)) {
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 <= (-235000.0d0)) .or. (.not. (z <= 3.7d0))) 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 <= -235000.0) || !(z <= 3.7)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -235000.0) or not (z <= 3.7): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -235000.0) || !(z <= 3.7)) 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 <= -235000.0) || ~((z <= 3.7))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -235000.0], N[Not[LessEqual[z, 3.7]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -235000 or 3.7000000000000002 < z Initial program 95.9%
Taylor expanded in y around 0 57.0%
mul-1-neg57.0%
distribute-neg-frac257.0%
neg-sub057.0%
associate--r-57.0%
metadata-eval57.0%
Simplified57.0%
Taylor expanded in z around inf 56.1%
if -235000 < z < 3.7000000000000002Initial program 93.4%
Taylor expanded in y around 0 36.8%
mul-1-neg36.8%
associate-/l*36.8%
distribute-rgt-neg-in36.8%
distribute-neg-frac236.8%
neg-sub036.8%
associate--r-36.8%
metadata-eval36.8%
Simplified36.8%
Taylor expanded in z around 0 35.1%
*-commutative35.1%
neg-mul-135.1%
distribute-rgt-neg-in35.1%
Simplified35.1%
Final simplification45.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -235000.0) (not (<= z 3.7))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -235000.0) || !(z <= 3.7)) {
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 <= (-235000.0d0)) .or. (.not. (z <= 3.7d0))) 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 <= -235000.0) || !(z <= 3.7)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -235000.0) or not (z <= 3.7): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -235000.0) || !(z <= 3.7)) 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 <= -235000.0) || ~((z <= 3.7))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -235000.0], N[Not[LessEqual[z, 3.7]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -235000 \lor \neg \left(z \leq 3.7\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -235000 or 3.7000000000000002 < z Initial program 95.9%
Taylor expanded in y around 0 52.6%
mul-1-neg52.6%
associate-/l*51.3%
distribute-rgt-neg-in51.3%
distribute-neg-frac251.3%
neg-sub051.3%
associate--r-51.3%
metadata-eval51.3%
Simplified51.3%
Taylor expanded in z around inf 51.7%
associate-/l*50.4%
Simplified50.4%
if -235000 < z < 3.7000000000000002Initial program 93.4%
Taylor expanded in y around 0 36.8%
mul-1-neg36.8%
associate-/l*36.8%
distribute-rgt-neg-in36.8%
distribute-neg-frac236.8%
neg-sub036.8%
associate--r-36.8%
metadata-eval36.8%
Simplified36.8%
Taylor expanded in z around 0 35.1%
*-commutative35.1%
neg-mul-135.1%
distribute-rgt-neg-in35.1%
Simplified35.1%
Final simplification42.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1e+98) (* x (/ t z)) (if (<= t 5.6e+158) (/ x (/ z y)) (* t (- x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1e+98) {
tmp = x * (t / z);
} else if (t <= 5.6e+158) {
tmp = x / (z / y);
} 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 (t <= (-1d+98)) then
tmp = x * (t / z)
else if (t <= 5.6d+158) then
tmp = x / (z / y)
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 (t <= -1e+98) {
tmp = x * (t / z);
} else if (t <= 5.6e+158) {
tmp = x / (z / y);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1e+98: tmp = x * (t / z) elif t <= 5.6e+158: tmp = x / (z / y) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1e+98) tmp = Float64(x * Float64(t / z)); elseif (t <= 5.6e+158) tmp = Float64(x / Float64(z / y)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1e+98) tmp = x * (t / z); elseif (t <= 5.6e+158) tmp = x / (z / y); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1e+98], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+158], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+158}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -9.99999999999999998e97Initial program 94.4%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
distribute-neg-frac279.1%
neg-sub079.1%
associate--r-79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in z around inf 55.1%
if -9.99999999999999998e97 < t < 5.60000000000000003e158Initial program 94.3%
Taylor expanded in y around inf 74.4%
associate-*r/75.6%
Simplified75.6%
clear-num75.5%
un-div-inv75.8%
Applied egg-rr75.8%
if 5.60000000000000003e158 < t Initial program 96.7%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
associate-/l*75.7%
distribute-rgt-neg-in75.7%
distribute-neg-frac275.7%
neg-sub075.7%
associate--r-75.7%
metadata-eval75.7%
Simplified75.7%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
neg-mul-156.7%
distribute-rgt-neg-in56.7%
Simplified56.7%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (if (<= t -4.6e+98) (* x (/ t z)) (if (<= t 1.8e+156) (* (/ y z) x) (* t (- x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.6e+98) {
tmp = x * (t / z);
} else if (t <= 1.8e+156) {
tmp = (y / z) * x;
} 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 (t <= (-4.6d+98)) then
tmp = x * (t / z)
else if (t <= 1.8d+156) then
tmp = (y / z) * x
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 (t <= -4.6e+98) {
tmp = x * (t / z);
} else if (t <= 1.8e+156) {
tmp = (y / z) * x;
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.6e+98: tmp = x * (t / z) elif t <= 1.8e+156: tmp = (y / z) * x else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.6e+98) tmp = Float64(x * Float64(t / z)); elseif (t <= 1.8e+156) tmp = Float64(Float64(y / z) * x); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.6e+98) tmp = x * (t / z); elseif (t <= 1.8e+156) tmp = (y / z) * x; else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.6e+98], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+156], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+156}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -4.60000000000000026e98Initial program 94.4%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
distribute-neg-frac279.1%
neg-sub079.1%
associate--r-79.1%
metadata-eval79.1%
Simplified79.1%
Taylor expanded in z around inf 55.1%
if -4.60000000000000026e98 < t < 1.79999999999999989e156Initial program 94.3%
Taylor expanded in y around inf 74.4%
associate-*r/75.6%
Simplified75.6%
if 1.79999999999999989e156 < t Initial program 96.7%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
associate-/l*75.7%
distribute-rgt-neg-in75.7%
distribute-neg-frac275.7%
neg-sub075.7%
associate--r-75.7%
metadata-eval75.7%
Simplified75.7%
Taylor expanded in z around 0 56.7%
*-commutative56.7%
neg-mul-156.7%
distribute-rgt-neg-in56.7%
Simplified56.7%
Final simplification69.4%
(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 94.6%
Taylor expanded in y around 0 44.6%
mul-1-neg44.6%
associate-/l*44.0%
distribute-rgt-neg-in44.0%
distribute-neg-frac244.0%
neg-sub044.0%
associate--r-44.0%
metadata-eval44.0%
Simplified44.0%
Taylor expanded in z around 0 22.8%
*-commutative22.8%
neg-mul-122.8%
distribute-rgt-neg-in22.8%
Simplified22.8%
Final simplification22.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 2024144
(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)))))