
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0))))) (if (<= t_1 4e+273) (* 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 <= 4e+273) {
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 <= 4d+273) 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 <= 4e+273) {
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 <= 4e+273: 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 <= 4e+273) 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 <= 4e+273) 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, 4e+273], 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 4 \cdot 10^{+273}:\\
\;\;\;\;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.99999999999999978e273Initial program 98.2%
if 3.99999999999999978e273 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 74.3%
Taylor expanded in y around inf 99.9%
associate-*r/99.9%
associate-*r*99.9%
neg-mul-199.9%
*-commutative99.9%
times-frac99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around 0 99.9%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.22e-8))) (* 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 <= 1.22e-8)) {
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 <= 1.22d-8))) 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 <= 1.22e-8)) {
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 <= 1.22e-8): 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 <= 1.22e-8)) 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 <= 1.22e-8))) 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, 1.22e-8]], $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 1.22 \cdot 10^{-8}\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 1.22e-8 < z Initial program 98.3%
Taylor expanded in z around inf 86.4%
associate-/l*97.3%
cancel-sign-sub-inv97.3%
metadata-eval97.3%
*-lft-identity97.3%
+-commutative97.3%
Simplified97.3%
if -1 < z < 1.22e-8Initial program 93.9%
Taylor expanded in z around 0 93.2%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.6e+65) (not (<= t 900.0))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.6e+65) || !(t <= 900.0)) {
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 <= (-5.6d+65)) .or. (.not. (t <= 900.0d0))) 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 <= -5.6e+65) || !(t <= 900.0)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.6e+65) or not (t <= 900.0): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.6e+65) || !(t <= 900.0)) 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 <= -5.6e+65) || ~((t <= 900.0))) 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, -5.6e+65], N[Not[LessEqual[t, 900.0]], $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.6 \cdot 10^{+65} \lor \neg \left(t \leq 900\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -5.5999999999999998e65 or 900 < t Initial program 96.7%
Taylor expanded in y around 0 70.8%
mul-1-neg70.8%
distribute-neg-frac270.8%
neg-sub070.8%
associate--r-70.8%
metadata-eval70.8%
Simplified70.8%
if -5.5999999999999998e65 < t < 900Initial program 95.7%
Taylor expanded in y around inf 82.9%
associate-*r/85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.9%
Applied egg-rr85.9%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.5e+77) (not (<= t 1000.0))) (* t (/ x (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e+77) || !(t <= 1000.0)) {
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 ((t <= (-4.5d+77)) .or. (.not. (t <= 1000.0d0))) 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 ((t <= -4.5e+77) || !(t <= 1000.0)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.5e+77) or not (t <= 1000.0): tmp = t * (x / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.5e+77) || !(t <= 1000.0)) 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 ((t <= -4.5e+77) || ~((t <= 1000.0))) tmp = t * (x / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.5e+77], N[Not[LessEqual[t, 1000.0]], $MachinePrecision]], 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}\;t \leq -4.5 \cdot 10^{+77} \lor \neg \left(t \leq 1000\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -4.50000000000000024e77 or 1e3 < t Initial program 96.6%
Taylor expanded in y around 0 62.8%
mul-1-neg62.8%
associate-/l*67.0%
distribute-rgt-neg-in67.0%
distribute-neg-frac267.0%
neg-sub067.0%
associate--r-67.0%
metadata-eval67.0%
Simplified67.0%
if -4.50000000000000024e77 < t < 1e3Initial program 95.7%
Taylor expanded in y around inf 82.4%
associate-*r/84.9%
Simplified84.9%
clear-num84.8%
un-div-inv85.3%
Applied egg-rr85.3%
Final simplification76.9%
(FPCore (x y z t) :precision binary64 (if (<= z -4.6e+75) (* (/ y z) x) (if (<= z 24000000.0) (* x (- (/ y z) t)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+75) {
tmp = (y / z) * x;
} else if (z <= 24000000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (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 <= (-4.6d+75)) then
tmp = (y / z) * x
else if (z <= 24000000.0d0) then
tmp = x * ((y / z) - t)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+75) {
tmp = (y / z) * x;
} else if (z <= 24000000.0) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.6e+75: tmp = (y / z) * x elif z <= 24000000.0: tmp = x * ((y / z) - t) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e+75) tmp = Float64(Float64(y / z) * x); elseif (z <= 24000000.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.6e+75) tmp = (y / z) * x; elseif (z <= 24000000.0) tmp = x * ((y / z) - t); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e+75], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 24000000.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+75}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq 24000000:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -4.5999999999999997e75Initial program 98.1%
Taylor expanded in y around inf 57.8%
associate-*r/61.5%
Simplified61.5%
if -4.5999999999999997e75 < z < 2.4e7Initial program 94.5%
Taylor expanded in z around 0 90.6%
if 2.4e7 < z Initial program 98.1%
Taylor expanded in y around 0 63.7%
mul-1-neg63.7%
distribute-neg-frac263.7%
neg-sub063.7%
associate--r-63.7%
metadata-eval63.7%
Simplified63.7%
Taylor expanded in z around inf 63.0%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.15e+138) (not (<= t 45000000.0))) (/ x (/ z t)) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.15e+138) || !(t <= 45000000.0)) {
tmp = x / (z / t);
} else {
tmp = x / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.15d+138)) .or. (.not. (t <= 45000000.0d0))) then
tmp = x / (z / t)
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.15e+138) || !(t <= 45000000.0)) {
tmp = x / (z / t);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.15e+138) or not (t <= 45000000.0): tmp = x / (z / t) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.15e+138) || !(t <= 45000000.0)) tmp = Float64(x / Float64(z / t)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.15e+138) || ~((t <= 45000000.0))) tmp = x / (z / t); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.15e+138], N[Not[LessEqual[t, 45000000.0]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+138} \lor \neg \left(t \leq 45000000\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.15000000000000004e138 or 4.5e7 < t Initial program 96.9%
Taylor expanded in y around 0 74.8%
mul-1-neg74.8%
distribute-neg-frac274.8%
neg-sub074.8%
associate--r-74.8%
metadata-eval74.8%
Simplified74.8%
clear-num74.7%
un-div-inv74.8%
+-commutative74.8%
Applied egg-rr74.8%
Taylor expanded in z around inf 52.1%
if -1.15000000000000004e138 < t < 4.5e7Initial program 95.6%
Taylor expanded in y around inf 78.2%
associate-*r/79.8%
Simplified79.8%
clear-num79.7%
un-div-inv80.2%
Applied egg-rr80.2%
Final simplification69.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2e+137) (not (<= t 45000000.0))) (/ x (/ z t)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2e+137) || !(t <= 45000000.0)) {
tmp = x / (z / t);
} else {
tmp = (y / z) * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2d+137)) .or. (.not. (t <= 45000000.0d0))) then
tmp = x / (z / t)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2e+137) || !(t <= 45000000.0)) {
tmp = x / (z / t);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2e+137) or not (t <= 45000000.0): tmp = x / (z / t) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2e+137) || !(t <= 45000000.0)) tmp = Float64(x / Float64(z / t)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2e+137) || ~((t <= 45000000.0))) tmp = x / (z / t); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2e+137], N[Not[LessEqual[t, 45000000.0]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+137} \lor \neg \left(t \leq 45000000\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -2.0000000000000001e137 or 4.5e7 < t Initial program 96.9%
Taylor expanded in y around 0 74.8%
mul-1-neg74.8%
distribute-neg-frac274.8%
neg-sub074.8%
associate--r-74.8%
metadata-eval74.8%
Simplified74.8%
clear-num74.7%
un-div-inv74.8%
+-commutative74.8%
Applied egg-rr74.8%
Taylor expanded in z around inf 52.1%
if -2.0000000000000001e137 < t < 4.5e7Initial program 95.6%
Taylor expanded in y around inf 78.2%
associate-*r/79.8%
Simplified79.8%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.1e+136) (not (<= t 45000000.0))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+136) || !(t <= 45000000.0)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.1d+136)) .or. (.not. (t <= 45000000.0d0))) then
tmp = x * (t / z)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+136) || !(t <= 45000000.0)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.1e+136) or not (t <= 45000000.0): tmp = x * (t / z) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.1e+136) || !(t <= 45000000.0)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.1e+136) || ~((t <= 45000000.0))) tmp = x * (t / z); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.1e+136], N[Not[LessEqual[t, 45000000.0]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+136} \lor \neg \left(t \leq 45000000\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -2.0999999999999999e136 or 4.5e7 < t Initial program 96.9%
Taylor expanded in y around 0 74.8%
mul-1-neg74.8%
distribute-neg-frac274.8%
neg-sub074.8%
associate--r-74.8%
metadata-eval74.8%
Simplified74.8%
Taylor expanded in z around inf 52.1%
if -2.0999999999999999e136 < t < 4.5e7Initial program 95.6%
Taylor expanded in y around inf 78.2%
associate-*r/79.8%
Simplified79.8%
Final simplification69.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.2))) (* x (/ t z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.2)) {
tmp = x * (t / z);
} 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 <= (-1.0d0)) .or. (.not. (z <= 1.2d0))) then
tmp = x * (t / z)
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 <= -1.0) || !(z <= 1.2)) {
tmp = x * (t / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.2): tmp = x * (t / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.2)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.2))) tmp = x * (t / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.2]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1.2\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or 1.19999999999999996 < z Initial program 98.3%
Taylor expanded in y around 0 56.1%
mul-1-neg56.1%
distribute-neg-frac256.1%
neg-sub056.1%
associate--r-56.1%
metadata-eval56.1%
Simplified56.1%
Taylor expanded in z around inf 55.3%
if -1 < z < 1.19999999999999996Initial program 94.0%
Taylor expanded in y around 0 36.3%
mul-1-neg36.3%
distribute-neg-frac236.3%
neg-sub036.3%
associate--r-36.3%
metadata-eval36.3%
Simplified36.3%
Taylor expanded in z around 0 35.7%
neg-mul-135.7%
*-commutative35.7%
distribute-rgt-neg-in35.7%
Simplified35.7%
Final simplification45.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.2))) (* t (/ x z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.2)) {
tmp = t * (x / z);
} 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 <= (-1.0d0)) .or. (.not. (z <= 1.2d0))) then
tmp = t * (x / z)
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 <= -1.0) || !(z <= 1.2)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.2): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.2)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.2))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.2]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1.2\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or 1.19999999999999996 < z Initial program 98.3%
Taylor expanded in y around 0 56.1%
mul-1-neg56.1%
distribute-neg-frac256.1%
neg-sub056.1%
associate--r-56.1%
metadata-eval56.1%
Simplified56.1%
Taylor expanded in z around inf 47.7%
associate-/l*51.4%
Simplified51.4%
if -1 < z < 1.19999999999999996Initial program 94.0%
Taylor expanded in y around 0 36.3%
mul-1-neg36.3%
distribute-neg-frac236.3%
neg-sub036.3%
associate--r-36.3%
metadata-eval36.3%
Simplified36.3%
Taylor expanded in z around 0 35.7%
neg-mul-135.7%
*-commutative35.7%
distribute-rgt-neg-in35.7%
Simplified35.7%
Final simplification43.5%
(FPCore (x y z t) :precision binary64 (if (<= z 1.2) (* x (- t)) (* t x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2) {
tmp = x * -t;
} 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 <= 1.2d0) then
tmp = x * -t
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 <= 1.2) {
tmp = x * -t;
} else {
tmp = t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.2: tmp = x * -t else: tmp = t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.2) tmp = Float64(x * Float64(-t)); else tmp = Float64(t * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.2) tmp = x * -t; else tmp = t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.2], N[(x * (-t)), $MachinePrecision], N[(t * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2:\\
\;\;\;\;x \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot x\\
\end{array}
\end{array}
if z < 1.19999999999999996Initial program 95.5%
Taylor expanded in y around 0 41.4%
mul-1-neg41.4%
distribute-neg-frac241.4%
neg-sub041.4%
associate--r-41.4%
metadata-eval41.4%
Simplified41.4%
Taylor expanded in z around 0 27.7%
neg-mul-127.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
if 1.19999999999999996 < z Initial program 98.2%
Taylor expanded in y around 0 62.2%
mul-1-neg62.2%
distribute-neg-frac262.2%
neg-sub062.2%
associate--r-62.2%
metadata-eval62.2%
Simplified62.2%
Taylor expanded in z around 0 10.4%
neg-mul-110.4%
*-commutative10.4%
distribute-rgt-neg-in10.4%
Simplified10.4%
add-sqr-sqrt2.4%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod12.9%
add-sqr-sqrt18.0%
pow118.0%
Applied egg-rr18.0%
unpow118.0%
Simplified18.0%
Final simplification25.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 * 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 x
\end{array}
Initial program 96.1%
Taylor expanded in y around 0 46.2%
mul-1-neg46.2%
distribute-neg-frac246.2%
neg-sub046.2%
associate--r-46.2%
metadata-eval46.2%
Simplified46.2%
Taylor expanded in z around 0 23.7%
neg-mul-123.7%
*-commutative23.7%
distribute-rgt-neg-in23.7%
Simplified23.7%
add-sqr-sqrt10.2%
sqrt-unprod15.1%
sqr-neg15.1%
sqrt-unprod6.1%
add-sqr-sqrt9.7%
pow19.7%
Applied egg-rr9.7%
unpow19.7%
Simplified9.7%
Final simplification9.7%
(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 2024129
(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)))))