
(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 8 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 (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+307)))
(/ (* x y) z)
(* x t_1))))
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)) || !(t_1 <= 1e+307)) {
tmp = (x * y) / z;
} else {
tmp = x * t_1;
}
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) || !(t_1 <= 1e+307)) {
tmp = (x * y) / z;
} else {
tmp = x * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (-1.0 + z)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+307): tmp = (x * y) / z else: tmp = x * t_1 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)) || !(t_1 <= 1e+307)) tmp = Float64(Float64(x * y) / z); else tmp = Float64(x * t_1); 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) || ~((t_1 <= 1e+307))) tmp = (x * y) / z; else tmp = x * t_1; 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+307]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{-1 + z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+307}\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 9.99999999999999986e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 66.5%
Taylor expanded in y around inf 100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 9.99999999999999986e306Initial program 98.2%
Final simplification98.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.08e-38) (* x (/ (+ t y) z)) (if (<= z 1.0) (/ (* x y) z) (* x (+ (/ y z) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e-38) {
tmp = x * ((t + y) / z);
} else if (z <= 1.0) {
tmp = (x * y) / z;
} else {
tmp = x * ((y / z) + (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 <= (-1.08d-38)) then
tmp = x * ((t + y) / z)
else if (z <= 1.0d0) then
tmp = (x * y) / z
else
tmp = x * ((y / z) + (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.08e-38) {
tmp = x * ((t + y) / z);
} else if (z <= 1.0) {
tmp = (x * y) / z;
} else {
tmp = x * ((y / z) + (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.08e-38: tmp = x * ((t + y) / z) elif z <= 1.0: tmp = (x * y) / z else: tmp = x * ((y / z) + (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.08e-38) tmp = Float64(x * Float64(Float64(t + y) / z)); elseif (z <= 1.0) tmp = Float64(Float64(x * y) / z); else tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.08e-38) tmp = x * ((t + y) / z); elseif (z <= 1.0) tmp = (x * y) / z; else tmp = x * ((y / z) + (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.08e-38], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-38}:\\
\;\;\;\;x \cdot \frac{t + y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.08e-38Initial program 95.1%
Taylor expanded in z around inf 82.6%
associate-/l*91.6%
cancel-sign-sub-inv91.6%
metadata-eval91.6%
*-lft-identity91.6%
+-commutative91.6%
Simplified91.6%
if -1.08e-38 < z < 1Initial program 90.6%
Taylor expanded in y around inf 73.1%
if 1 < z Initial program 99.8%
Taylor expanded in z around inf 82.7%
associate-/l*99.2%
cancel-sign-sub-inv99.2%
metadata-eval99.2%
*-lft-identity99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (<= x 4e+44) (+ (/ (* x t) (+ -1.0 z)) (/ (* x y) z)) (* x (+ (/ y z) (/ t (+ -1.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4e+44) {
tmp = ((x * t) / (-1.0 + z)) + ((x * y) / z);
} else {
tmp = x * ((y / z) + (t / (-1.0 + 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 (x <= 4d+44) then
tmp = ((x * t) / ((-1.0d0) + z)) + ((x * y) / z)
else
tmp = x * ((y / z) + (t / ((-1.0d0) + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4e+44) {
tmp = ((x * t) / (-1.0 + z)) + ((x * y) / z);
} else {
tmp = x * ((y / z) + (t / (-1.0 + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 4e+44: tmp = ((x * t) / (-1.0 + z)) + ((x * y) / z) else: tmp = x * ((y / z) + (t / (-1.0 + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 4e+44) tmp = Float64(Float64(Float64(x * t) / Float64(-1.0 + z)) + Float64(Float64(x * y) / z)); else tmp = Float64(x * Float64(Float64(y / z) + Float64(t / Float64(-1.0 + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 4e+44) tmp = ((x * t) / (-1.0 + z)) + ((x * y) / z); else tmp = x * ((y / z) + (t / (-1.0 + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 4e+44], N[(N[(N[(x * t), $MachinePrecision] / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+44}:\\
\;\;\;\;\frac{x \cdot t}{-1 + z} + \frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{-1 + z}\right)\\
\end{array}
\end{array}
if x < 4.0000000000000004e44Initial program 92.5%
Taylor expanded in y around 0 92.2%
if 4.0000000000000004e44 < x Initial program 99.8%
Final simplification93.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e-38) (not (<= z 1.0))) (* x (/ (+ t y) z)) (/ (* x y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-38) || !(z <= 1.0)) {
tmp = x * ((t + y) / 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 ((z <= (-1.1d-38)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((t + y) / 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 ((z <= -1.1e-38) || !(z <= 1.0)) {
tmp = x * ((t + y) / z);
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1e-38) or not (z <= 1.0): tmp = x * ((t + y) / z) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e-38) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(t + y) / z)); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1e-38) || ~((z <= 1.0))) tmp = x * ((t + y) / z); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e-38], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-38} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{t + y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if z < -1.10000000000000004e-38 or 1 < z Initial program 97.2%
Taylor expanded in z around inf 82.6%
associate-/l*94.8%
cancel-sign-sub-inv94.8%
metadata-eval94.8%
*-lft-identity94.8%
+-commutative94.8%
Simplified94.8%
if -1.10000000000000004e-38 < z < 1Initial program 90.6%
Taylor expanded in y around inf 73.1%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.8e+117) (not (<= t 6.2e+114))) (* t (/ x (+ -1.0 z))) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e+117) || !(t <= 6.2e+114)) {
tmp = t * (x / (-1.0 + 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 <= (-2.8d+117)) .or. (.not. (t <= 6.2d+114))) then
tmp = t * (x / ((-1.0d0) + 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 <= -2.8e+117) || !(t <= 6.2e+114)) {
tmp = t * (x / (-1.0 + z));
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.8e+117) or not (t <= 6.2e+114): tmp = t * (x / (-1.0 + z)) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.8e+117) || !(t <= 6.2e+114)) tmp = Float64(t * Float64(x / Float64(-1.0 + 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 <= -2.8e+117) || ~((t <= 6.2e+114))) tmp = t * (x / (-1.0 + z)); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.8e+117], N[Not[LessEqual[t, 6.2e+114]], $MachinePrecision]], N[(t * N[(x / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+117} \lor \neg \left(t \leq 6.2 \cdot 10^{+114}\right):\\
\;\;\;\;t \cdot \frac{x}{-1 + z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -2.79999999999999997e117 or 6.2000000000000001e114 < t Initial program 96.1%
Taylor expanded in y around 0 68.1%
mul-1-neg68.1%
associate-/l*72.5%
distribute-rgt-neg-in72.5%
distribute-neg-frac272.5%
neg-sub072.5%
associate--r-72.5%
metadata-eval72.5%
Simplified72.5%
if -2.79999999999999997e117 < t < 6.2000000000000001e114Initial program 93.1%
Taylor expanded in y around inf 78.0%
associate-*r/78.9%
Simplified78.9%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.6e+115) (not (<= t 1.9e+206))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.6e+115) || !(t <= 1.9e+206)) {
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 <= (-9.6d+115)) .or. (.not. (t <= 1.9d+206))) 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 <= -9.6e+115) || !(t <= 1.9e+206)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.6e+115) or not (t <= 1.9e+206): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.6e+115) || !(t <= 1.9e+206)) 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 <= -9.6e+115) || ~((t <= 1.9e+206))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.6e+115], N[Not[LessEqual[t, 1.9e+206]], $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 -9.6 \cdot 10^{+115} \lor \neg \left(t \leq 1.9 \cdot 10^{+206}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -9.6000000000000001e115 or 1.8999999999999999e206 < t Initial program 94.2%
Taylor expanded in z around inf 48.2%
associate-/l*60.0%
cancel-sign-sub-inv60.0%
metadata-eval60.0%
*-lft-identity60.0%
+-commutative60.0%
Simplified60.0%
Taylor expanded in t around inf 52.3%
if -9.6000000000000001e115 < t < 1.8999999999999999e206Initial program 93.9%
Taylor expanded in y around inf 76.0%
associate-*r/77.3%
Simplified77.3%
Final simplification70.8%
(FPCore (x y z t) :precision binary64 (* x (/ t z)))
double code(double x, double y, double z, double t) {
return x * (t / 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 * (t / z)
end function
public static double code(double x, double y, double z, double t) {
return x * (t / z);
}
def code(x, y, z, t): return x * (t / z)
function code(x, y, z, t) return Float64(x * Float64(t / z)) end
function tmp = code(x, y, z, t) tmp = x * (t / z); end
code[x_, y_, z_, t_] := N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{t}{z}
\end{array}
Initial program 94.0%
Taylor expanded in z around inf 68.8%
associate-/l*72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
Simplified72.7%
Taylor expanded in t around inf 33.9%
(FPCore (x y z t) :precision binary64 (* t (/ x z)))
double code(double x, double y, double z, double t) {
return t * (x / 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 = t * (x / z)
end function
public static double code(double x, double y, double z, double t) {
return t * (x / z);
}
def code(x, y, z, t): return t * (x / z)
function code(x, y, z, t) return Float64(t * Float64(x / z)) end
function tmp = code(x, y, z, t) tmp = t * (x / z); end
code[x_, y_, z_, t_] := N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x}{z}
\end{array}
Initial program 94.0%
Taylor expanded in z around inf 68.8%
associate-/l*72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-lft-identity72.7%
+-commutative72.7%
Simplified72.7%
Taylor expanded in t around inf 30.1%
associate-/l*32.5%
Simplified32.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 2024186
(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)))))