
(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 98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -8.2e-200)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 3.7e-73)
(+ 1.0 (/ (/ x y) (- z y)))
(+ 1.0 (* x (/ (/ -1.0 t) (- z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.2e-200) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.7e-73) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + (x * ((-1.0 / t) / (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 <= (-8.2d-200)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.7d-73) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 + (x * (((-1.0d0) / t) / (z - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.2e-200) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.7e-73) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + (x * ((-1.0 / t) / (z - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.2e-200: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.7e-73: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 + (x * ((-1.0 / t) / (z - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.2e-200) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.7e-73) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / t) / Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -8.2e-200) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.7e-73) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 + (x * ((-1.0 / t) / (z - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.2e-200], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-73], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(N[(-1.0 / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-200}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-73}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{t}}{z - y}\\
\end{array}
\end{array}
if t < -8.19999999999999974e-200Initial program 98.8%
Taylor expanded in z around inf 80.2%
+-commutative80.2%
associate-/r*81.2%
Simplified81.2%
if -8.19999999999999974e-200 < t < 3.7000000000000001e-73Initial program 97.5%
Taylor expanded in t around 0 93.9%
associate-/r*93.9%
Simplified93.9%
if 3.7000000000000001e-73 < t Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
*-commutative99.9%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 97.5%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3600000000.0) 1.0 (if (<= y 1.9e+66) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3600000000.0) {
tmp = 1.0;
} else if (y <= 1.9e+66) {
tmp = 1.0 + ((x / t) / (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 (y <= (-3600000000.0d0)) then
tmp = 1.0d0
else if (y <= 1.9d+66) then
tmp = 1.0d0 + ((x / t) / (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 (y <= -3600000000.0) {
tmp = 1.0;
} else if (y <= 1.9e+66) {
tmp = 1.0 + ((x / t) / (y - z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3600000000.0: tmp = 1.0 elif y <= 1.9e+66: tmp = 1.0 + ((x / t) / (y - z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3600000000.0) tmp = 1.0; elseif (y <= 1.9e+66) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3600000000.0) tmp = 1.0; elseif (y <= 1.9e+66) tmp = 1.0 + ((x / t) / (y - z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3600000000.0], 1.0, If[LessEqual[y, 1.9e+66], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3600000000:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+66}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.6e9 or 1.9000000000000001e66 < y Initial program 100.0%
Taylor expanded in x around 0 95.4%
if -3.6e9 < y < 1.9000000000000001e66Initial program 97.9%
Taylor expanded in t around inf 80.1%
+-commutative80.1%
associate-/r*81.2%
Simplified81.2%
Final simplification87.1%
(FPCore (x y z t)
:precision binary64
(if (<= t -8.2e-200)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.02e-72)
(+ 1.0 (/ x (* y (- z y))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.2e-200) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.02e-72) {
tmp = 1.0 + (x / (y * (z - 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 <= (-8.2d-200)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.02d-72) then
tmp = 1.0d0 + (x / (y * (z - 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 <= -8.2e-200) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.02e-72) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.2e-200: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.02e-72: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.2e-200) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.02e-72) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - 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 <= -8.2e-200) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.02e-72) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.2e-200], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e-72], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $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 -8.2 \cdot 10^{-200}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-72}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.19999999999999974e-200Initial program 98.8%
Taylor expanded in z around inf 80.2%
+-commutative80.2%
associate-/r*81.2%
Simplified81.2%
if -8.19999999999999974e-200 < t < 1.02e-72Initial program 97.5%
Taylor expanded in t around 0 93.9%
if 1.02e-72 < t Initial program 99.9%
Taylor expanded in t around inf 97.5%
+-commutative97.5%
associate-/r*97.5%
Simplified97.5%
Final simplification90.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.9e-202)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 5.2e-73)
(+ 1.0 (/ (/ x y) (- z y)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.9e-202) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.2e-73) {
tmp = 1.0 + ((x / y) / (z - 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 <= (-3.9d-202)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 5.2d-73) then
tmp = 1.0d0 + ((x / y) / (z - 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 <= -3.9e-202) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 5.2e-73) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.9e-202: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 5.2e-73: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.9e-202) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 5.2e-73) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - 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 <= -3.9e-202) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 5.2e-73) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.9e-202], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-73], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - 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 -3.9 \cdot 10^{-202}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-73}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.8999999999999999e-202Initial program 98.9%
Taylor expanded in z around inf 80.4%
+-commutative80.4%
associate-/r*81.4%
Simplified81.4%
if -3.8999999999999999e-202 < t < 5.2000000000000002e-73Initial program 97.5%
Taylor expanded in t around 0 93.9%
associate-/r*93.8%
Simplified93.8%
if 5.2000000000000002e-73 < t Initial program 99.9%
Taylor expanded in t around inf 97.5%
+-commutative97.5%
associate-/r*97.5%
Simplified97.5%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e-51) 1.0 (if (<= z 1e-215) (+ 1.0 (/ x (* y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-51) {
tmp = 1.0;
} else if (z <= 1e-215) {
tmp = 1.0 + (x / (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 (z <= (-3.5d-51)) then
tmp = 1.0d0
else if (z <= 1d-215) then
tmp = 1.0d0 + (x / (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 (z <= -3.5e-51) {
tmp = 1.0;
} else if (z <= 1e-215) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e-51: tmp = 1.0 elif z <= 1e-215: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e-51) tmp = 1.0; elseif (z <= 1e-215) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e-51) tmp = 1.0; elseif (z <= 1e-215) tmp = 1.0 + (x / (y * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e-51], 1.0, If[LessEqual[z, 1e-215], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-51}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 10^{-215}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -3.4999999999999997e-51 or 1.00000000000000004e-215 < z Initial program 99.9%
Taylor expanded in x around 0 76.8%
if -3.4999999999999997e-51 < z < 1.00000000000000004e-215Initial program 95.7%
Taylor expanded in t around inf 82.6%
+-commutative82.6%
associate-/r*86.8%
Simplified86.8%
Taylor expanded in y around inf 74.1%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e-27) 1.0 (if (<= y 3.7e-103) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-27) {
tmp = 1.0;
} else if (y <= 3.7e-103) {
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.5d-27)) then
tmp = 1.0d0
else if (y <= 3.7d-103) 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.5e-27) {
tmp = 1.0;
} else if (y <= 3.7e-103) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-27: tmp = 1.0 elif y <= 3.7e-103: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-27) tmp = 1.0; elseif (y <= 3.7e-103) 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.5e-27) tmp = 1.0; elseif (y <= 3.7e-103) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-27], 1.0, If[LessEqual[y, 3.7e-103], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-27}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-103}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.5000000000000001e-27 or 3.6999999999999999e-103 < y Initial program 100.0%
Taylor expanded in x around 0 84.7%
if -3.5000000000000001e-27 < y < 3.6999999999999999e-103Initial program 97.0%
Taylor expanded in y around 0 75.1%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1e-26) 1.0 (if (<= y 3.8e-28) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e-26) {
tmp = 1.0;
} else if (y <= 3.8e-28) {
tmp = 1.0 - ((x / t) / 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 (y <= (-1d-26)) then
tmp = 1.0d0
else if (y <= 3.8d-28) then
tmp = 1.0d0 - ((x / t) / 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 (y <= -1e-26) {
tmp = 1.0;
} else if (y <= 3.8e-28) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1e-26: tmp = 1.0 elif y <= 3.8e-28: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1e-26) tmp = 1.0; elseif (y <= 3.8e-28) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1e-26) tmp = 1.0; elseif (y <= 3.8e-28) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-26], 1.0, If[LessEqual[y, 3.8e-28], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-26}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-28}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1e-26 or 3.80000000000000009e-28 < y Initial program 100.0%
Taylor expanded in x around 0 89.6%
if -1e-26 < y < 3.80000000000000009e-28Initial program 97.5%
clear-num97.4%
associate-/r/97.5%
*-commutative97.5%
associate-/r*97.4%
Applied egg-rr97.4%
Taylor expanded in y around 0 80.4%
Taylor expanded in y around 0 71.2%
associate-/r*71.8%
Simplified71.8%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.95e-87) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.95e-87) {
tmp = 1.0 + ((x / z) / (y - t));
} 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 (z <= (-1.95d-87)) then
tmp = 1.0d0 + ((x / z) / (y - t))
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 (z <= -1.95e-87) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.95e-87: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.95e-87) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); 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 (z <= -1.95e-87) tmp = 1.0 + ((x / z) / (y - t)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.95e-87], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $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}\;z \leq -1.95 \cdot 10^{-87}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.9499999999999999e-87Initial program 99.9%
Taylor expanded in z around inf 95.5%
+-commutative95.5%
associate-/r*95.6%
Simplified95.6%
if -1.9499999999999999e-87 < z Initial program 98.3%
Taylor expanded in t around inf 78.1%
+-commutative78.1%
associate-/r*79.1%
Simplified79.1%
Final simplification83.9%
(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.8%
Taylor expanded in x around 0 72.3%
Final simplification72.3%
herbie shell --seed 2024095
(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)))))