
(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 10 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 99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.8e-173)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.55e-68)
(+ 1.0 (/ 1.0 (/ (* y (- z y)) x)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-173) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.55e-68) {
tmp = 1.0 + (1.0 / ((y * (z - y)) / x));
} else {
tmp = 1.0 + ((x / t) / (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 <= (-5.8d-173)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.55d-68) then
tmp = 1.0d0 + (1.0d0 / ((y * (z - y)) / x))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-173) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.55e-68) {
tmp = 1.0 + (1.0 / ((y * (z - y)) / x));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.8e-173: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.55e-68: tmp = 1.0 + (1.0 / ((y * (z - y)) / x)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.8e-173) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.55e-68) tmp = Float64(1.0 + Float64(1.0 / Float64(Float64(y * Float64(z - y)) / x))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.8e-173) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.55e-68) tmp = 1.0 + (1.0 / ((y * (z - y)) / x)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e-173], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-68], N[(1.0 + N[(1.0 / N[(N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-173}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-68}:\\
\;\;\;\;1 + \frac{1}{\frac{y \cdot \left(z - y\right)}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -5.7999999999999997e-173Initial program 99.0%
Taylor expanded in z around inf 79.8%
associate-/r*79.8%
Simplified79.8%
if -5.7999999999999997e-173 < t < 1.55e-68Initial program 99.9%
clear-num99.8%
inv-pow99.8%
associate-/l*99.0%
Applied egg-rr99.0%
unpow-199.0%
Simplified99.0%
Taylor expanded in t around 0 88.6%
if 1.55e-68 < t Initial program 99.9%
Taylor expanded in t around inf 96.9%
associate-/r*97.0%
Simplified97.0%
Final simplification88.6%
(FPCore (x y z t)
:precision binary64
(if (<= t 2.2e-176)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 6.8e-72)
(+ 1.0 (/ (/ x y) (- t y)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.2e-176) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 6.8e-72) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (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.2d-176) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 6.8d-72) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + ((x / t) / (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.2e-176) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 6.8e-72) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.2e-176: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 6.8e-72: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.2e-176) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 6.8e-72) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.2e-176) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 6.8e-72) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.2e-176], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-72], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.2 \cdot 10^{-176}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-72}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.1999999999999999e-176Initial program 99.3%
Taylor expanded in z around inf 82.3%
associate-/r*82.4%
Simplified82.4%
if 2.1999999999999999e-176 < t < 6.7999999999999997e-72Initial program 100.0%
Taylor expanded in z around 0 84.4%
sub-neg84.4%
associate-/r*84.5%
distribute-neg-frac284.5%
neg-sub084.5%
sub-neg84.5%
+-commutative84.5%
associate--r+84.5%
neg-sub084.5%
remove-double-neg84.5%
Simplified84.5%
if 6.7999999999999997e-72 < t Initial program 99.9%
Taylor expanded in t around inf 96.9%
associate-/r*97.0%
Simplified97.0%
(FPCore (x y z t)
:precision binary64
(if (<= t 1.5e-174)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 1.05e-67)
(+ 1.0 (/ (/ x y) (- t y)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e-174) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1.05e-67) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (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 <= 1.5d-174) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 1.05d-67) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.5e-174) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1.05e-67) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.5e-174: tmp = 1.0 + (x / (z * (y - t))) elif t <= 1.05e-67: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.5e-174) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 1.05e-67) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.5e-174) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 1.05e-67) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.5e-174], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-67], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.5 \cdot 10^{-174}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-67}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 1.50000000000000011e-174Initial program 99.3%
clear-num99.3%
inv-pow99.3%
associate-/l*99.1%
Applied egg-rr99.1%
unpow-199.1%
Simplified99.1%
Taylor expanded in z around inf 82.3%
if 1.50000000000000011e-174 < t < 1.0500000000000001e-67Initial program 100.0%
Taylor expanded in z around 0 84.4%
sub-neg84.4%
associate-/r*84.5%
distribute-neg-frac284.5%
neg-sub084.5%
sub-neg84.5%
+-commutative84.5%
associate--r+84.5%
neg-sub084.5%
remove-double-neg84.5%
Simplified84.5%
if 1.0500000000000001e-67 < t Initial program 99.9%
Taylor expanded in t around inf 96.9%
associate-/r*97.0%
Simplified97.0%
(FPCore (x y z t) :precision binary64 (if (<= t 6e-175) (+ 1.0 (/ x (* z (- y t)))) (if (<= t 9.2e-74) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e-175) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 9.2e-74) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (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 <= 6d-175) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 9.2d-74) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 6e-175) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 9.2e-74) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 6e-175: tmp = 1.0 + (x / (z * (y - t))) elif t <= 9.2e-74: tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 6e-175) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 9.2e-74) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 6e-175) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 9.2e-74) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 6e-175], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-74], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6 \cdot 10^{-175}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-74}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 6e-175Initial program 99.3%
clear-num99.3%
inv-pow99.3%
associate-/l*99.1%
Applied egg-rr99.1%
unpow-199.1%
Simplified99.1%
Taylor expanded in z around inf 82.3%
if 6e-175 < t < 9.19999999999999922e-74Initial program 100.0%
Taylor expanded in z around 0 84.4%
sub-neg84.4%
associate-/r*84.5%
distribute-neg-frac284.5%
neg-sub084.5%
sub-neg84.5%
+-commutative84.5%
associate--r+84.5%
neg-sub084.5%
remove-double-neg84.5%
Simplified84.5%
Taylor expanded in t around 0 84.6%
neg-mul-184.6%
Simplified84.6%
if 9.19999999999999922e-74 < t Initial program 99.9%
Taylor expanded in t around inf 96.9%
associate-/r*97.0%
Simplified97.0%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e-10) (- 1.0 (/ (/ x y) y)) (if (<= y 1.85e+14) (+ 1.0 (/ x (* z (- y t)))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-10) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.85e+14) {
tmp = 1.0 + (x / (z * (y - 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.3d-10)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 1.85d+14) then
tmp = 1.0d0 + (x / (z * (y - 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.3e-10) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 1.85e+14) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-10: tmp = 1.0 - ((x / y) / y) elif y <= 1.85e+14: tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-10) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 1.85e+14) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.3e-10) tmp = 1.0 - ((x / y) / y); elseif (y <= 1.85e+14) tmp = 1.0 + (x / (z * (y - t))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-10], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+14], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-10}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+14}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.3e-10Initial program 99.9%
Taylor expanded in z around 0 95.0%
sub-neg95.0%
associate-/r*95.0%
distribute-neg-frac295.0%
neg-sub095.0%
sub-neg95.0%
+-commutative95.0%
associate--r+95.0%
neg-sub095.0%
remove-double-neg95.0%
Simplified95.0%
Taylor expanded in t around 0 91.8%
neg-mul-191.8%
Simplified91.8%
if -3.3e-10 < y < 1.85e14Initial program 99.1%
clear-num99.1%
inv-pow99.1%
associate-/l*98.9%
Applied egg-rr98.9%
unpow-198.9%
Simplified98.9%
Taylor expanded in z around inf 82.1%
if 1.85e14 < y Initial program 100.0%
Taylor expanded in x around 0 97.8%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.4e-59) (- 1.0 (/ (/ x y) y)) (if (<= y 6e-120) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-59) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 6e-120) {
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.4d-59)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 6d-120) 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.4e-59) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 6e-120) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e-59: tmp = 1.0 - ((x / y) / y) elif y <= 6e-120: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-59) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 6e-120) 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.4e-59) tmp = 1.0 - ((x / y) / y); elseif (y <= 6e-120) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-59], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-120], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-59}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-120}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.40000000000000018e-59Initial program 100.0%
Taylor expanded in z around 0 94.1%
sub-neg94.1%
associate-/r*94.2%
distribute-neg-frac294.2%
neg-sub094.2%
sub-neg94.2%
+-commutative94.2%
associate--r+94.2%
neg-sub094.2%
remove-double-neg94.2%
Simplified94.2%
Taylor expanded in t around 0 89.8%
neg-mul-189.8%
Simplified89.8%
if -3.40000000000000018e-59 < y < 6.00000000000000022e-120Initial program 98.8%
Taylor expanded in y around 0 82.5%
if 6.00000000000000022e-120 < y Initial program 100.0%
Taylor expanded in x around 0 84.5%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= y -3e-52) 1.0 (if (<= y 1e-118) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e-52) {
tmp = 1.0;
} else if (y <= 1e-118) {
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 <= (-3d-52)) then
tmp = 1.0d0
else if (y <= 1d-118) 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 <= -3e-52) {
tmp = 1.0;
} else if (y <= 1e-118) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3e-52: tmp = 1.0 elif y <= 1e-118: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3e-52) tmp = 1.0; elseif (y <= 1e-118) 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 <= -3e-52) tmp = 1.0; elseif (y <= 1e-118) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e-52], 1.0, If[LessEqual[y, 1e-118], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 10^{-118}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3e-52 or 9.99999999999999985e-119 < y Initial program 100.0%
Taylor expanded in x around 0 86.3%
if -3e-52 < y < 9.99999999999999985e-119Initial program 98.8%
Taylor expanded in y around 0 82.0%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= t 1.45e-219) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.45e-219) {
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.45d-219) 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.45e-219) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.45e-219: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.45e-219) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.45e-219) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.45e-219], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{-219}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 1.44999999999999992e-219Initial program 99.3%
clear-num99.3%
inv-pow99.3%
associate-/l*99.1%
Applied egg-rr99.1%
unpow-199.1%
Simplified99.1%
Taylor expanded in z around inf 82.8%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
Simplified63.3%
if 1.44999999999999992e-219 < t Initial program 99.9%
Taylor expanded in x around 0 80.3%
Final simplification71.3%
(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 99.6%
Taylor expanded in x around 0 76.5%
herbie shell --seed 2024157
(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)))))