
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 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 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 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 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0))))
(if (<= t_1 5e+293)
t_1
(-
(/ x (+ x 1.0))
(/ (+ (- 0.0 (/ y (+ x 1.0))) (/ (/ x z) (+ x 1.0))) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+293) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) - (((0.0 - (y / (x + 1.0))) + ((x / z) / (x + 1.0))) / 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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
if (t_1 <= 5d+293) then
tmp = t_1
else
tmp = (x / (x + 1.0d0)) - (((0.0d0 - (y / (x + 1.0d0))) + ((x / z) / (x + 1.0d0))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+293) {
tmp = t_1;
} else {
tmp = (x / (x + 1.0)) - (((0.0 - (y / (x + 1.0))) + ((x / z) / (x + 1.0))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0) tmp = 0 if t_1 <= 5e+293: tmp = t_1 else: tmp = (x / (x + 1.0)) - (((0.0 - (y / (x + 1.0))) + ((x / z) / (x + 1.0))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= 5e+293) tmp = t_1; else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(Float64(0.0 - Float64(y / Float64(x + 1.0))) + Float64(Float64(x / z) / Float64(x + 1.0))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); tmp = 0.0; if (t_1 <= 5e+293) tmp = t_1; else tmp = (x / (x + 1.0)) - (((0.0 - (y / (x + 1.0))) + ((x / z) / (x + 1.0))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+293], t$95$1, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(0.0 - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\left(0 - \frac{y}{x + 1}\right) + \frac{\frac{x}{z}}{x + 1}}{t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5.00000000000000033e293Initial program 96.6%
if 5.00000000000000033e293 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 22.9%
Taylor expanded in t around -inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))) (if (<= t_1 5e+293) t_1 (* (/ 1.0 (+ x 1.0)) (+ x (/ y t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+293) {
tmp = t_1;
} else {
tmp = (1.0 / (x + 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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
if (t_1 <= 5d+293) then
tmp = t_1
else
tmp = (1.0d0 / (x + 1.0d0)) * (x + (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
double tmp;
if (t_1 <= 5e+293) {
tmp = t_1;
} else {
tmp = (1.0 / (x + 1.0)) * (x + (y / t));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0) tmp = 0 if t_1 <= 5e+293: tmp = t_1 else: tmp = (1.0 / (x + 1.0)) * (x + (y / t)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_1 <= 5e+293) tmp = t_1; else tmp = Float64(Float64(1.0 / Float64(x + 1.0)) * Float64(x + Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); tmp = 0.0; if (t_1 <= 5e+293) tmp = t_1; else tmp = (1.0 / (x + 1.0)) * (x + (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+293], t$95$1, N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + 1} \cdot \left(x + \frac{y}{t}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5.00000000000000033e293Initial program 96.6%
if 5.00000000000000033e293 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 22.9%
Taylor expanded in z around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(if (<= x -1.2e-53)
(/ (+ x (/ 1.0 (- 1.0 (/ (* z (- t y)) x)))) (+ x 1.0))
(if (<= x 4.1e-262)
(/ (- x (/ (- (/ x z) y) t)) (+ x 1.0))
(/ (+ x (* (/ 1.0 (- (* z t) x)) (* z y))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.2e-53) {
tmp = (x + (1.0 / (1.0 - ((z * (t - y)) / x)))) / (x + 1.0);
} else if (x <= 4.1e-262) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 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 (x <= (-1.2d-53)) then
tmp = (x + (1.0d0 / (1.0d0 - ((z * (t - y)) / x)))) / (x + 1.0d0)
else if (x <= 4.1d-262) then
tmp = (x - (((x / z) - y) / t)) / (x + 1.0d0)
else
tmp = (x + ((1.0d0 / ((z * t) - x)) * (z * y))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.2e-53) {
tmp = (x + (1.0 / (1.0 - ((z * (t - y)) / x)))) / (x + 1.0);
} else if (x <= 4.1e-262) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.2e-53: tmp = (x + (1.0 / (1.0 - ((z * (t - y)) / x)))) / (x + 1.0) elif x <= 4.1e-262: tmp = (x - (((x / z) - y) / t)) / (x + 1.0) else: tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.2e-53) tmp = Float64(Float64(x + Float64(1.0 / Float64(1.0 - Float64(Float64(z * Float64(t - y)) / x)))) / Float64(x + 1.0)); elseif (x <= 4.1e-262) tmp = Float64(Float64(x - Float64(Float64(Float64(x / z) - y) / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(1.0 / Float64(Float64(z * t) - x)) * Float64(z * y))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.2e-53) tmp = (x + (1.0 / (1.0 - ((z * (t - y)) / x)))) / (x + 1.0); elseif (x <= 4.1e-262) tmp = (x - (((x / z) - y) / t)) / (x + 1.0); else tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.2e-53], N[(N[(x + N[(1.0 / N[(1.0 - N[(N[(z * N[(t - y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e-262], N[(N[(x - N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(1.0 / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-53}:\\
\;\;\;\;\frac{x + \frac{1}{1 - \frac{z \cdot \left(t - y\right)}{x}}}{x + 1}\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-262}:\\
\;\;\;\;\frac{x - \frac{\frac{x}{z} - y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{z \cdot t - x} \cdot \left(z \cdot y\right)}{x + 1}\\
\end{array}
\end{array}
if x < -1.20000000000000004e-53Initial program 85.1%
Applied egg-rr0
Taylor expanded in z around 0 0
Simplified0
if -1.20000000000000004e-53 < x < 4.10000000000000026e-262Initial program 88.1%
Taylor expanded in t around -inf 0
Simplified0
if 4.10000000000000026e-262 < x Initial program 93.9%
Applied egg-rr0
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z t)
:precision binary64
(if (<= x -2.7e-54)
(/ (- x (/ x (- (* t z) x))) (+ x 1.0))
(if (<= x 4.1e-265)
(/ (- x (/ (- (/ x z) y) t)) (+ x 1.0))
(/ (+ x (* (/ 1.0 (- (* z t) x)) (* z y))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.7e-54) {
tmp = (x - (x / ((t * z) - x))) / (x + 1.0);
} else if (x <= 4.1e-265) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 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 (x <= (-2.7d-54)) then
tmp = (x - (x / ((t * z) - x))) / (x + 1.0d0)
else if (x <= 4.1d-265) then
tmp = (x - (((x / z) - y) / t)) / (x + 1.0d0)
else
tmp = (x + ((1.0d0 / ((z * t) - x)) * (z * y))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.7e-54) {
tmp = (x - (x / ((t * z) - x))) / (x + 1.0);
} else if (x <= 4.1e-265) {
tmp = (x - (((x / z) - y) / t)) / (x + 1.0);
} else {
tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.7e-54: tmp = (x - (x / ((t * z) - x))) / (x + 1.0) elif x <= 4.1e-265: tmp = (x - (((x / z) - y) / t)) / (x + 1.0) else: tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.7e-54) tmp = Float64(Float64(x - Float64(x / Float64(Float64(t * z) - x))) / Float64(x + 1.0)); elseif (x <= 4.1e-265) tmp = Float64(Float64(x - Float64(Float64(Float64(x / z) - y) / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(1.0 / Float64(Float64(z * t) - x)) * Float64(z * y))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.7e-54) tmp = (x - (x / ((t * z) - x))) / (x + 1.0); elseif (x <= 4.1e-265) tmp = (x - (((x / z) - y) / t)) / (x + 1.0); else tmp = (x + ((1.0 / ((z * t) - x)) * (z * y))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.7e-54], N[(N[(x - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e-265], N[(N[(x - N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(1.0 / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{x - \frac{x}{t \cdot z - x}}{x + 1}\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-265}:\\
\;\;\;\;\frac{x - \frac{\frac{x}{z} - y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{z \cdot t - x} \cdot \left(z \cdot y\right)}{x + 1}\\
\end{array}
\end{array}
if x < -2.70000000000000026e-54Initial program 85.1%
Taylor expanded in y around 0 0
Simplified0
if -2.70000000000000026e-54 < x < 4.1e-265Initial program 88.1%
Taylor expanded in t around -inf 0
Simplified0
if 4.1e-265 < x Initial program 93.9%
Applied egg-rr0
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.26e-151)
t_1
(if (<= t 5.2e-101) (- 1.0 (* (/ z x) (/ y (+ 1.0 x)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.26e-151) {
tmp = t_1;
} else if (t <= 5.2e-101) {
tmp = 1.0 - ((z / x) * (y / (1.0 + x)));
} 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 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1.26d-151)) then
tmp = t_1
else if (t <= 5.2d-101) then
tmp = 1.0d0 - ((z / x) * (y / (1.0d0 + x)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.26e-151) {
tmp = t_1;
} else if (t <= 5.2e-101) {
tmp = 1.0 - ((z / x) * (y / (1.0 + x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.26e-151: tmp = t_1 elif t <= 5.2e-101: tmp = 1.0 - ((z / x) * (y / (1.0 + x))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.26e-151) tmp = t_1; elseif (t <= 5.2e-101) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / Float64(1.0 + x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -1.26e-151) tmp = t_1; elseif (t <= 5.2e-101) tmp = 1.0 - ((z / x) * (y / (1.0 + x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.26e-151], t$95$1, If[LessEqual[t, 5.2e-101], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.26 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-101}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.2600000000000001e-151 or 5.2000000000000002e-101 < t Initial program 90.3%
Taylor expanded in z around inf 0
Simplified0
if -1.2600000000000001e-151 < t < 5.2000000000000002e-101Initial program 88.0%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -6.5e-151)
t_1
(if (<= t 4.2e-103) (- 1.0 (* (/ z x) (/ y x))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -6.5e-151) {
tmp = t_1;
} else if (t <= 4.2e-103) {
tmp = 1.0 - ((z / x) * (y / x));
} 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 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-6.5d-151)) then
tmp = t_1
else if (t <= 4.2d-103) then
tmp = 1.0d0 - ((z / x) * (y / x))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -6.5e-151) {
tmp = t_1;
} else if (t <= 4.2e-103) {
tmp = 1.0 - ((z / x) * (y / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -6.5e-151: tmp = t_1 elif t <= 4.2e-103: tmp = 1.0 - ((z / x) * (y / x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -6.5e-151) tmp = t_1; elseif (t <= 4.2e-103) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -6.5e-151) tmp = t_1; elseif (t <= 4.2e-103) tmp = 1.0 - ((z / x) * (y / x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e-151], t$95$1, If[LessEqual[t, 4.2e-103], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-103}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.4999999999999994e-151 or 4.20000000000000009e-103 < t Initial program 90.3%
Taylor expanded in z around inf 0
Simplified0
if -6.4999999999999994e-151 < t < 4.20000000000000009e-103Initial program 88.0%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= x -3.4e-51) 1.0 (if (<= x 5.2e-6) (/ (+ x (/ y t)) 1.0) (- 1.0 (* (/ z x) (/ y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-51) {
tmp = 1.0;
} else if (x <= 5.2e-6) {
tmp = (x + (y / t)) / 1.0;
} else {
tmp = 1.0 - ((z / x) * (y / x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-3.4d-51)) then
tmp = 1.0d0
else if (x <= 5.2d-6) then
tmp = (x + (y / t)) / 1.0d0
else
tmp = 1.0d0 - ((z / x) * (y / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-51) {
tmp = 1.0;
} else if (x <= 5.2e-6) {
tmp = (x + (y / t)) / 1.0;
} else {
tmp = 1.0 - ((z / x) * (y / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.4e-51: tmp = 1.0 elif x <= 5.2e-6: tmp = (x + (y / t)) / 1.0 else: tmp = 1.0 - ((z / x) * (y / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.4e-51) tmp = 1.0; elseif (x <= 5.2e-6) tmp = Float64(Float64(x + Float64(y / t)) / 1.0); else tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.4e-51) tmp = 1.0; elseif (x <= 5.2e-6) tmp = (x + (y / t)) / 1.0; else tmp = 1.0 - ((z / x) * (y / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e-51], 1.0, If[LessEqual[x, 5.2e-6], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-51}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\end{array}
\end{array}
if x < -3.40000000000000003e-51Initial program 85.1%
Taylor expanded in x around inf 0
Simplified0
if -3.40000000000000003e-51 < x < 5.20000000000000019e-6Initial program 91.5%
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 5.20000000000000019e-6 < x Initial program 92.1%
Taylor expanded in z around 0 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= x -3.4e-51) 1.0 (if (<= x 4.2e-16) (/ (+ x (/ y t)) 1.0) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-51) {
tmp = 1.0;
} else if (x <= 4.2e-16) {
tmp = (x + (y / t)) / 1.0;
} else {
tmp = x / (x + 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 (x <= (-3.4d-51)) then
tmp = 1.0d0
else if (x <= 4.2d-16) then
tmp = (x + (y / t)) / 1.0d0
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-51) {
tmp = 1.0;
} else if (x <= 4.2e-16) {
tmp = (x + (y / t)) / 1.0;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.4e-51: tmp = 1.0 elif x <= 4.2e-16: tmp = (x + (y / t)) / 1.0 else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.4e-51) tmp = 1.0; elseif (x <= 4.2e-16) tmp = Float64(Float64(x + Float64(y / t)) / 1.0); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.4e-51) tmp = 1.0; elseif (x <= 4.2e-16) tmp = (x + (y / t)) / 1.0; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e-51], 1.0, If[LessEqual[x, 4.2e-16], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-51}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -3.40000000000000003e-51Initial program 85.1%
Taylor expanded in x around inf 0
Simplified0
if -3.40000000000000003e-51 < x < 4.2000000000000002e-16Initial program 91.2%
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 4.2000000000000002e-16 < x Initial program 92.7%
Taylor expanded in t around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= x -1.65e-52) 1.0 (if (<= x 1.6e-74) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.65e-52) {
tmp = 1.0;
} else if (x <= 1.6e-74) {
tmp = y / t;
} else {
tmp = x / (x + 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 (x <= (-1.65d-52)) then
tmp = 1.0d0
else if (x <= 1.6d-74) then
tmp = y / t
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.65e-52) {
tmp = 1.0;
} else if (x <= 1.6e-74) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.65e-52: tmp = 1.0 elif x <= 1.6e-74: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.65e-52) tmp = 1.0; elseif (x <= 1.6e-74) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.65e-52) tmp = 1.0; elseif (x <= 1.6e-74) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.65e-52], 1.0, If[LessEqual[x, 1.6e-74], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -1.64999999999999998e-52Initial program 85.1%
Taylor expanded in x around inf 0
Simplified0
if -1.64999999999999998e-52 < x < 1.5999999999999999e-74Initial program 90.4%
Taylor expanded in x around 0 0
Simplified0
if 1.5999999999999999e-74 < x Initial program 93.2%
Taylor expanded in t around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= x -3.2e-51) 1.0 (if (<= x 9.5e-17) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-51) {
tmp = 1.0;
} else if (x <= 9.5e-17) {
tmp = 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 (x <= (-3.2d-51)) then
tmp = 1.0d0
else if (x <= 9.5d-17) then
tmp = 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 (x <= -3.2e-51) {
tmp = 1.0;
} else if (x <= 9.5e-17) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.2e-51: tmp = 1.0 elif x <= 9.5e-17: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.2e-51) tmp = 1.0; elseif (x <= 9.5e-17) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.2e-51) tmp = 1.0; elseif (x <= 9.5e-17) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.2e-51], 1.0, If[LessEqual[x, 9.5e-17], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-51}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.2e-51 or 9.50000000000000029e-17 < x Initial program 88.6%
Taylor expanded in x around inf 0
Simplified0
if -3.2e-51 < x < 9.50000000000000029e-17Initial program 91.2%
Taylor expanded in x around 0 0
Simplified0
(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 89.7%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 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 = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))