
(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 9 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 (or (<= y -9e-221) (not (<= y 4e-50))) (+ 1.0 (/ x (* y (- z y)))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e-221) || !(y <= 4e-50)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 - (x / (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 ((y <= (-9d-221)) .or. (.not. (y <= 4d-50))) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e-221) || !(y <= 4e-50)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e-221) or not (y <= 4e-50): tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e-221) || !(y <= 4e-50)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9e-221) || ~((y <= 4e-50))) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e-221], N[Not[LessEqual[y, 4e-50]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-221} \lor \neg \left(y \leq 4 \cdot 10^{-50}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -9.00000000000000052e-221 or 4.00000000000000003e-50 < y Initial program 99.5%
Taylor expanded in t around 0 84.0%
if -9.00000000000000052e-221 < y < 4.00000000000000003e-50Initial program 99.9%
Taylor expanded in y around 0 88.7%
Final simplification85.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.2e-75)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.7e-119)
(+ 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.2e-75) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.7e-119) {
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.2d-75)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.7d-119) 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.2e-75) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.7e-119) {
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.2e-75: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.7e-119: 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.2e-75) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.7e-119) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.2e-75) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.7e-119) 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.2e-75], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-119], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-75}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-119}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.2000000000000001e-75Initial program 99.9%
Taylor expanded in z around inf 71.6%
mul-1-neg71.6%
associate-/r*69.2%
distribute-neg-frac69.2%
Simplified69.2%
if -1.2000000000000001e-75 < t < 1.70000000000000012e-119Initial program 98.8%
clear-num98.9%
associate-/r/98.8%
Applied egg-rr98.8%
Taylor expanded in t around 0 90.8%
*-lft-identity90.8%
times-frac90.9%
associate-*l/90.9%
*-lft-identity90.9%
Simplified90.9%
if 1.70000000000000012e-119 < t Initial program 100.0%
Taylor expanded in t around inf 95.6%
associate-*r/95.6%
neg-mul-195.6%
Simplified95.6%
Final simplification84.7%
(FPCore (x y z t) :precision binary64 (if (<= y -9e-221) (+ 1.0 (/ (/ x (- z y)) y)) (if (<= y 3.4e-50) (- 1.0 (/ x (* z t))) (+ 1.0 (/ (/ x y) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-221) {
tmp = 1.0 + ((x / (z - y)) / y);
} else if (y <= 3.4e-50) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + ((x / y) / (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 (y <= (-9d-221)) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else if (y <= 3.4d-50) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 + ((x / y) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-221) {
tmp = 1.0 + ((x / (z - y)) / y);
} else if (y <= 3.4e-50) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + ((x / y) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-221: tmp = 1.0 + ((x / (z - y)) / y) elif y <= 3.4e-50: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 + ((x / y) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-221) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); elseif (y <= 3.4e-50) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-221) tmp = 1.0 + ((x / (z - y)) / y); elseif (y <= 3.4e-50) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 + ((x / y) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-221], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-50], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-221}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-50}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\end{array}
\end{array}
if y < -9.00000000000000052e-221Initial program 99.1%
clear-num99.1%
associate-/r/99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 80.9%
*-lft-identity80.9%
times-frac80.9%
associate-*l/80.9%
*-lft-identity80.9%
Simplified80.9%
if -9.00000000000000052e-221 < y < 3.40000000000000014e-50Initial program 99.9%
Taylor expanded in y around 0 88.7%
if 3.40000000000000014e-50 < y Initial program 99.9%
Taylor expanded in t around 0 87.8%
associate-/r*87.8%
Simplified87.8%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= y -8.5e-221) (+ 1.0 (/ x (* y (- z y)))) (if (<= y 4e-50) (- 1.0 (/ x (* z t))) (+ 1.0 (/ (/ x y) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-221) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (y <= 4e-50) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + ((x / y) / (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 (y <= (-8.5d-221)) then
tmp = 1.0d0 + (x / (y * (z - y)))
else if (y <= 4d-50) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 + ((x / y) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-221) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (y <= 4e-50) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + ((x / y) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.5e-221: tmp = 1.0 + (x / (y * (z - y))) elif y <= 4e-50: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 + ((x / y) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e-221) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); elseif (y <= 4e-50) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.5e-221) tmp = 1.0 + (x / (y * (z - y))); elseif (y <= 4e-50) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 + ((x / y) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e-221], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-50], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-221}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-50}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\end{array}
\end{array}
if y < -8.49999999999999984e-221Initial program 99.1%
Taylor expanded in t around 0 80.9%
if -8.49999999999999984e-221 < y < 4.00000000000000003e-50Initial program 99.9%
Taylor expanded in y around 0 88.7%
if 4.00000000000000003e-50 < y Initial program 99.9%
Taylor expanded in t around 0 87.8%
associate-/r*87.8%
Simplified87.8%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.7e+249) (- 1.0 (/ x (* z t))) (if (<= z -1.95e-28) (+ 1.0 (/ (/ x z) y)) (+ 1.0 (/ x (* y (- t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+249) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -1.95e-28) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + (x / (y * (t - 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 (z <= (-1.7d+249)) then
tmp = 1.0d0 - (x / (z * t))
else if (z <= (-1.95d-28)) then
tmp = 1.0d0 + ((x / z) / y)
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+249) {
tmp = 1.0 - (x / (z * t));
} else if (z <= -1.95e-28) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e+249: tmp = 1.0 - (x / (z * t)) elif z <= -1.95e-28: tmp = 1.0 + ((x / z) / y) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e+249) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (z <= -1.95e-28) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e+249) tmp = 1.0 - (x / (z * t)); elseif (z <= -1.95e-28) tmp = 1.0 + ((x / z) / y); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+249], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.95e-28], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+249}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-28}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -1.70000000000000006e249Initial program 100.0%
Taylor expanded in y around 0 100.0%
if -1.70000000000000006e249 < z < -1.94999999999999999e-28Initial program 100.0%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 85.3%
*-lft-identity85.3%
times-frac85.2%
associate-*l/85.3%
*-lft-identity85.3%
Simplified85.3%
Taylor expanded in y around 0 82.9%
associate-*r/82.9%
mul-1-neg82.9%
Simplified82.9%
if -1.94999999999999999e-28 < z Initial program 99.4%
Taylor expanded in z around 0 79.9%
Final simplification81.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7.2e-111) 1.0 (if (<= y 2.25e-63) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e-111) {
tmp = 1.0;
} else if (y <= 2.25e-63) {
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 <= (-7.2d-111)) then
tmp = 1.0d0
else if (y <= 2.25d-63) 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 <= -7.2e-111) {
tmp = 1.0;
} else if (y <= 2.25e-63) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e-111: tmp = 1.0 elif y <= 2.25e-63: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e-111) tmp = 1.0; elseif (y <= 2.25e-63) 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 <= -7.2e-111) tmp = 1.0; elseif (y <= 2.25e-63) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e-111], 1.0, If[LessEqual[y, 2.25e-63], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-111}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-63}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.20000000000000019e-111 or 2.25e-63 < y Initial program 99.9%
Taylor expanded in t around 0 88.4%
Taylor expanded in y around 0 62.3%
associate-*r/62.3%
neg-mul-162.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in x around 0 87.0%
if -7.20000000000000019e-111 < y < 2.25e-63Initial program 98.9%
Taylor expanded in y around 0 79.8%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (if (<= t 3.5e-119) (+ 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 <= 3.5e-119) {
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 <= 3.5d-119) 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 <= 3.5e-119) {
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 <= 3.5e-119: 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 <= 3.5e-119) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.5e-119) 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, 3.5e-119], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-119}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 3.5e-119Initial program 99.4%
clear-num99.4%
associate-/r/99.3%
Applied egg-rr99.3%
Taylor expanded in t around 0 73.5%
*-lft-identity73.5%
times-frac73.6%
associate-*l/73.6%
*-lft-identity73.6%
Simplified73.6%
if 3.5e-119 < t Initial program 100.0%
Taylor expanded in t around inf 95.6%
associate-*r/95.6%
neg-mul-195.6%
Simplified95.6%
Final simplification80.5%
(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 t around 0 72.7%
Taylor expanded in y around 0 53.8%
associate-*r/53.8%
neg-mul-153.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in x around 0 74.9%
herbie shell --seed 2024085
(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)))))