
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
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 = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 98.5%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ x (* z (- y t))))))
(if (<= z -2e-137)
t_1
(if (<= z -2.35e-276)
(- 1.0 (/ (/ x y) y))
(if (<= z 4.75e-169) (+ 1.0 (/ x (* y t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (x / (z * (y - t)));
double tmp;
if (z <= -2e-137) {
tmp = t_1;
} else if (z <= -2.35e-276) {
tmp = 1.0 - ((x / y) / y);
} else if (z <= 4.75e-169) {
tmp = 1.0 + (x / (y * t));
} 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 = 1.0d0 + (x / (z * (y - t)))
if (z <= (-2d-137)) then
tmp = t_1
else if (z <= (-2.35d-276)) then
tmp = 1.0d0 - ((x / y) / y)
else if (z <= 4.75d-169) then
tmp = 1.0d0 + (x / (y * t))
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 = 1.0 + (x / (z * (y - t)));
double tmp;
if (z <= -2e-137) {
tmp = t_1;
} else if (z <= -2.35e-276) {
tmp = 1.0 - ((x / y) / y);
} else if (z <= 4.75e-169) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (x / (z * (y - t))) tmp = 0 if z <= -2e-137: tmp = t_1 elif z <= -2.35e-276: tmp = 1.0 - ((x / y) / y) elif z <= 4.75e-169: tmp = 1.0 + (x / (y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))) tmp = 0.0 if (z <= -2e-137) tmp = t_1; elseif (z <= -2.35e-276) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (z <= 4.75e-169) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (x / (z * (y - t))); tmp = 0.0; if (z <= -2e-137) tmp = t_1; elseif (z <= -2.35e-276) tmp = 1.0 - ((x / y) / y); elseif (z <= 4.75e-169) tmp = 1.0 + (x / (y * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-137], t$95$1, If[LessEqual[z, -2.35e-276], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.75e-169], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-276}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;z \leq 4.75 \cdot 10^{-169}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.99999999999999996e-137 or 4.7500000000000001e-169 < z Initial program 99.9%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6491.0%
Simplified91.0%
if -1.99999999999999996e-137 < z < -2.34999999999999982e-276Initial program 95.1%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6470.4%
Simplified70.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.5%
Applied egg-rr72.5%
if -2.34999999999999982e-276 < z < 4.7500000000000001e-169Initial program 95.6%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6471.4%
Simplified71.4%
Taylor expanded in y around inf
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6469.2%
Simplified69.2%
Final simplification84.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.92e-97)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 2.9e-94)
(+ 1.0 (/ (/ x (- z y)) y))
(+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.92e-97) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 2.9e-94) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((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 (t <= (-1.92d-97)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 2.9d-94) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else
tmp = 1.0d0 + ((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 (t <= -1.92e-97) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 2.9e-94) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.92e-97: tmp = 1.0 + (x / (z * (y - t))) elif t <= 2.9e-94: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.92e-97) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 2.9e-94) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.92e-97) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 2.9e-94) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.92e-97], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-94], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.92 \cdot 10^{-97}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-94}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if t < -1.92000000000000004e-97Initial program 100.0%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6483.8%
Simplified83.8%
if -1.92000000000000004e-97 < t < 2.89999999999999995e-94Initial program 96.1%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6486.0%
Simplified86.0%
if 2.89999999999999995e-94 < t Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6488.8%
Simplified88.8%
Final simplification86.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.4e-152)
(+ 1.0 (/ x (* z (- y t))))
(if (<= z 4.2e-214)
(+ 1.0 (/ x (* y (- t y))))
(+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.4e-152) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 4.2e-214) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((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 <= (-4.4d-152)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (z <= 4.2d-214) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = 1.0d0 + ((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 <= -4.4e-152) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 4.2e-214) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.4e-152: tmp = 1.0 + (x / (z * (y - t))) elif z <= 4.2e-214: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.4e-152) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (z <= 4.2e-214) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.4e-152) tmp = 1.0 + (x / (z * (y - t))); elseif (z <= 4.2e-214) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.4e-152], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-214], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-152}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-214}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -4.3999999999999997e-152Initial program 99.9%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6488.7%
Simplified88.7%
if -4.3999999999999997e-152 < z < 4.19999999999999984e-214Initial program 94.6%
Taylor expanded in z around 0
*-lowering-*.f64N/A
--lowering--.f6491.6%
Simplified91.6%
if 4.19999999999999984e-214 < z Initial program 99.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6478.7%
Simplified78.7%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.8e-137) (+ 1.0 (/ x (* z (- y t)))) (if (<= z -3.3e-248) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x (- y z)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e-137) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= -3.3e-248) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((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 <= (-2.8d-137)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (z <= (-3.3d-248)) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + ((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 <= -2.8e-137) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= -3.3e-248) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / (y - z)) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e-137: tmp = 1.0 + (x / (z * (y - t))) elif z <= -3.3e-248: tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / (y - z)) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e-137) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (z <= -3.3e-248) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / Float64(y - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e-137) tmp = 1.0 + (x / (z * (y - t))); elseif (z <= -3.3e-248) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + ((x / (y - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e-137], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-248], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-137}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-248}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if z < -2.7999999999999999e-137Initial program 99.9%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6489.4%
Simplified89.4%
if -2.7999999999999999e-137 < z < -3.3000000000000002e-248Initial program 96.8%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6471.2%
Simplified71.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6471.3%
Applied egg-rr71.3%
if -3.3000000000000002e-248 < z Initial program 98.1%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.1%
Simplified77.1%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e-53) (- 1.0 (/ (/ x y) y)) (if (<= y 8e-139) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-53) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 8e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
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 <= (-2.1d-53)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 8d-139) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-53) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 8e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-53: tmp = 1.0 - ((x / y) / y) elif y <= 8e-139: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-53) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 8e-139) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e-53) tmp = 1.0 - ((x / y) / y); elseif (y <= 8e-139) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-53], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-139], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-53}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-139}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.09999999999999977e-53Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.9%
Simplified86.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.9%
Applied egg-rr86.9%
if -2.09999999999999977e-53 < y < 8.00000000000000024e-139Initial program 95.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.0%
Simplified75.0%
if 8.00000000000000024e-139 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified90.2%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3.8e-53) (- 1.0 (/ x (* y y))) (if (<= y 8e-139) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-53) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 8e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
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.8d-53)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 8d-139) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-53) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 8e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e-53: tmp = 1.0 - (x / (y * y)) elif y <= 8e-139: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e-53) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 8e-139) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.8e-53) tmp = 1.0 - (x / (y * y)); elseif (y <= 8e-139) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e-53], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-139], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-53}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-139}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.7999999999999998e-53Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6486.9%
Simplified86.9%
if -3.7999999999999998e-53 < y < 8.00000000000000024e-139Initial program 95.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.0%
Simplified75.0%
if 8.00000000000000024e-139 < y Initial program 100.0%
Taylor expanded in x around 0
Simplified90.2%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.3e-56) 1.0 (if (<= y 6.5e-139) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-56) {
tmp = 1.0;
} else if (y <= 6.5e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
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.3d-56)) then
tmp = 1.0d0
else if (y <= 6.5d-139) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.3e-56) {
tmp = 1.0;
} else if (y <= 6.5e-139) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.3e-56: tmp = 1.0 elif y <= 6.5e-139: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.3e-56) tmp = 1.0; elseif (y <= 6.5e-139) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.3e-56) tmp = 1.0; elseif (y <= 6.5e-139) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.3e-56], 1.0, If[LessEqual[y, 6.5e-139], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-56}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-139}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.29999999999999998e-56 or 6.5e-139 < y Initial program 99.9%
Taylor expanded in x around 0
Simplified87.8%
if -1.29999999999999998e-56 < y < 6.5e-139Initial program 95.9%
Taylor expanded in y around 0
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.0%
Simplified75.0%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (<= t 1.8e-192) (+ 1.0 (/ (/ x y) z)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.8e-192) {
tmp = 1.0 + ((x / y) / z);
} else {
tmp = 1.0;
}
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.8d-192) then
tmp = 1.0d0 + ((x / y) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.8e-192) {
tmp = 1.0 + ((x / y) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.8e-192: tmp = 1.0 + ((x / y) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.8e-192) tmp = Float64(1.0 + Float64(Float64(x / y) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.8e-192) tmp = 1.0 + ((x / y) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.8e-192], N[(1.0 + N[(N[(x / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.8 \cdot 10^{-192}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 1.7999999999999999e-192Initial program 97.8%
Taylor expanded in t around 0
--lowering--.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.5%
Simplified75.5%
Taylor expanded in z around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6458.3%
Simplified58.3%
if 1.7999999999999999e-192 < t Initial program 99.9%
Taylor expanded in x around 0
Simplified74.5%
(FPCore (x y z t) :precision binary64 (if (<= z -3.4e-118) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e-118) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * 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 <= (-3.4d-118)) then
tmp = 1.0d0
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e-118) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.4e-118: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.4e-118) tmp = 1.0; else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.4e-118) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.4e-118], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-118}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.39999999999999991e-118Initial program 99.9%
Taylor expanded in x around 0
Simplified81.0%
if -3.39999999999999991e-118 < z Initial program 97.9%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
mul-1-negN/A
remove-double-negN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6476.1%
Simplified76.1%
Taylor expanded in y around inf
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6458.7%
Simplified58.7%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 98.5%
Taylor expanded in x around 0
Simplified71.9%
herbie shell --seed 2024138
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))