
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (/ (/ 1.0 (- y z)) (/ (- t z) x)))
double code(double x, double y, double z, double t) {
return (1.0 / (y - z)) / ((t - z) / x);
}
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 / (y - z)) / ((t - z) / x)
end function
public static double code(double x, double y, double z, double t) {
return (1.0 / (y - z)) / ((t - z) / x);
}
def code(x, y, z, t): return (1.0 / (y - z)) / ((t - z) / x)
function code(x, y, z, t) return Float64(Float64(1.0 / Float64(y - z)) / Float64(Float64(t - z) / x)) end
function tmp = code(x, y, z, t) tmp = (1.0 / (y - z)) / ((t - z) / x); end
code[x_, y_, z_, t_] := N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{y - z}}{\frac{t - z}{x}}
\end{array}
Initial program 88.6%
associate-/l/98.7%
div-inv98.6%
Applied egg-rr98.6%
*-commutative98.6%
clear-num98.3%
un-div-inv98.5%
Applied egg-rr98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x y) (- t z))))
(if (<= t -5.8e-147)
t_1
(if (<= t 4.5e-158)
(/ x (* z (- z y)))
(if (<= t 2.1e-82)
t_1
(if (<= t 2e-37) (/ x (* z (- z t))) (/ (/ x t) (- y z))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) / (t - z);
double tmp;
if (t <= -5.8e-147) {
tmp = t_1;
} else if (t <= 4.5e-158) {
tmp = x / (z * (z - y));
} else if (t <= 2.1e-82) {
tmp = t_1;
} else if (t <= 2e-37) {
tmp = x / (z * (z - t));
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = (x / y) / (t - z)
if (t <= (-5.8d-147)) then
tmp = t_1
else if (t <= 4.5d-158) then
tmp = x / (z * (z - y))
else if (t <= 2.1d-82) then
tmp = t_1
else if (t <= 2d-37) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) / (t - z);
double tmp;
if (t <= -5.8e-147) {
tmp = t_1;
} else if (t <= 4.5e-158) {
tmp = x / (z * (z - y));
} else if (t <= 2.1e-82) {
tmp = t_1;
} else if (t <= 2e-37) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) / (t - z) tmp = 0 if t <= -5.8e-147: tmp = t_1 elif t <= 4.5e-158: tmp = x / (z * (z - y)) elif t <= 2.1e-82: tmp = t_1 elif t <= 2e-37: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) / Float64(t - z)) tmp = 0.0 if (t <= -5.8e-147) tmp = t_1; elseif (t <= 4.5e-158) tmp = Float64(x / Float64(z * Float64(z - y))); elseif (t <= 2.1e-82) tmp = t_1; elseif (t <= 2e-37) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) / (t - z); tmp = 0.0; if (t <= -5.8e-147) tmp = t_1; elseif (t <= 4.5e-158) tmp = x / (z * (z - y)); elseif (t <= 2.1e-82) tmp = t_1; elseif (t <= 2e-37) tmp = x / (z * (z - t)); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e-147], t$95$1, If[LessEqual[t, 4.5e-158], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-82], t$95$1, If[LessEqual[t, 2e-37], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y}}{t - z}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-158}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -5.8000000000000002e-147 or 4.5e-158 < t < 2.1e-82Initial program 91.1%
Taylor expanded in y around inf 58.6%
associate-/r*61.5%
Simplified61.5%
if -5.8000000000000002e-147 < t < 4.5e-158Initial program 87.6%
Taylor expanded in t around 0 80.4%
mul-1-neg80.4%
distribute-rgt-neg-in80.4%
neg-sub080.4%
sub-neg80.4%
+-commutative80.4%
associate--r+80.4%
neg-sub080.4%
remove-double-neg80.4%
Simplified80.4%
if 2.1e-82 < t < 2.00000000000000013e-37Initial program 100.0%
Taylor expanded in y around 0 90.3%
mul-1-neg90.3%
distribute-rgt-neg-in90.3%
sub-neg90.3%
+-commutative90.3%
distribute-neg-in90.3%
remove-double-neg90.3%
unsub-neg90.3%
Simplified90.3%
if 2.00000000000000013e-37 < t Initial program 84.3%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in t around inf 88.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.5e+123)
(/ (/ x y) t)
(if (<= y -2.3e-112)
(/ x (* z (- z y)))
(if (<= y 1.6e-154) (/ x (* z (- z t))) (/ (/ x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e+123) {
tmp = (x / y) / t;
} else if (y <= -2.3e-112) {
tmp = x / (z * (z - y));
} else if (y <= 1.6e-154) {
tmp = x / (z * (z - t));
} else {
tmp = (x / 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 (y <= (-1.5d+123)) then
tmp = (x / y) / t
else if (y <= (-2.3d-112)) then
tmp = x / (z * (z - y))
else if (y <= 1.6d-154) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.5e+123) {
tmp = (x / y) / t;
} else if (y <= -2.3e-112) {
tmp = x / (z * (z - y));
} else if (y <= 1.6e-154) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.5e+123: tmp = (x / y) / t elif y <= -2.3e-112: tmp = x / (z * (z - y)) elif y <= 1.6e-154: tmp = x / (z * (z - t)) else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.5e+123) tmp = Float64(Float64(x / y) / t); elseif (y <= -2.3e-112) tmp = Float64(x / Float64(z * Float64(z - y))); elseif (y <= 1.6e-154) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.5e+123) tmp = (x / y) / t; elseif (y <= -2.3e-112) tmp = x / (z * (z - y)); elseif (y <= 1.6e-154) tmp = x / (z * (z - t)); else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.5e+123], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -2.3e-112], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-154], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+123}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-154}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -1.50000000000000004e123Initial program 87.6%
Taylor expanded in y around inf 84.9%
associate-/r*92.8%
Simplified92.8%
Taylor expanded in t around inf 75.7%
if -1.50000000000000004e123 < y < -2.29999999999999991e-112Initial program 90.5%
Taylor expanded in t around 0 53.8%
mul-1-neg53.8%
distribute-rgt-neg-in53.8%
neg-sub053.8%
sub-neg53.8%
+-commutative53.8%
associate--r+53.8%
neg-sub053.8%
remove-double-neg53.8%
Simplified53.8%
if -2.29999999999999991e-112 < y < 1.60000000000000002e-154Initial program 90.3%
Taylor expanded in y around 0 78.5%
mul-1-neg78.5%
distribute-rgt-neg-in78.5%
sub-neg78.5%
+-commutative78.5%
distribute-neg-in78.5%
remove-double-neg78.5%
unsub-neg78.5%
Simplified78.5%
if 1.60000000000000002e-154 < y Initial program 86.3%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around inf 49.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.04e+99)
(/ (/ x y) t)
(if (<= y -5.2e+23)
(/ x (* y (- z)))
(if (<= y 1.6e-154) (/ x (* z (- z t))) (/ (/ x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.04e+99) {
tmp = (x / y) / t;
} else if (y <= -5.2e+23) {
tmp = x / (y * -z);
} else if (y <= 1.6e-154) {
tmp = x / (z * (z - t));
} else {
tmp = (x / 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 (y <= (-1.04d+99)) then
tmp = (x / y) / t
else if (y <= (-5.2d+23)) then
tmp = x / (y * -z)
else if (y <= 1.6d-154) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.04e+99) {
tmp = (x / y) / t;
} else if (y <= -5.2e+23) {
tmp = x / (y * -z);
} else if (y <= 1.6e-154) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.04e+99: tmp = (x / y) / t elif y <= -5.2e+23: tmp = x / (y * -z) elif y <= 1.6e-154: tmp = x / (z * (z - t)) else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.04e+99) tmp = Float64(Float64(x / y) / t); elseif (y <= -5.2e+23) tmp = Float64(x / Float64(y * Float64(-z))); elseif (y <= 1.6e-154) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.04e+99) tmp = (x / y) / t; elseif (y <= -5.2e+23) tmp = x / (y * -z); elseif (y <= 1.6e-154) tmp = x / (z * (z - t)); else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.04e+99], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -5.2e+23], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-154], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.04 \cdot 10^{+99}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-154}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -1.04e99Initial program 89.2%
Taylor expanded in y around inf 83.6%
associate-/r*91.1%
Simplified91.1%
Taylor expanded in t around inf 72.9%
if -1.04e99 < y < -5.19999999999999983e23Initial program 90.4%
Taylor expanded in t around 0 65.0%
mul-1-neg65.0%
distribute-rgt-neg-in65.0%
neg-sub065.0%
sub-neg65.0%
+-commutative65.0%
associate--r+65.0%
neg-sub065.0%
remove-double-neg65.0%
Simplified65.0%
Taylor expanded in z around 0 53.3%
associate-*r/53.3%
neg-mul-153.3%
*-commutative53.3%
Simplified53.3%
if -5.19999999999999983e23 < y < 1.60000000000000002e-154Initial program 90.0%
Taylor expanded in y around 0 67.0%
mul-1-neg67.0%
distribute-rgt-neg-in67.0%
sub-neg67.0%
+-commutative67.0%
distribute-neg-in67.0%
remove-double-neg67.0%
unsub-neg67.0%
Simplified67.0%
if 1.60000000000000002e-154 < y Initial program 86.3%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around inf 53.3%
Taylor expanded in y around inf 49.6%
Final simplification61.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (<= t_1 2e+301) (/ x t_1) (* (/ x (- t z)) (/ -1.0 z)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+301) {
tmp = x / t_1;
} else {
tmp = (x / (t - z)) * (-1.0 / 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) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 2d+301) then
tmp = x / t_1
else
tmp = (x / (t - z)) * ((-1.0d0) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+301) {
tmp = x / t_1;
} else {
tmp = (x / (t - z)) * (-1.0 / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 2e+301: tmp = x / t_1 else: tmp = (x / (t - z)) * (-1.0 / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= 2e+301) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(t - z)) * Float64(-1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if (t_1 <= 2e+301) tmp = x / t_1; else tmp = (x / (t - z)) * (-1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+301], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000011e301Initial program 94.6%
if 2.00000000000000011e301 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 72.9%
associate-/l/100.0%
div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 84.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.9e-75) (/ (/ x y) (- t z)) (if (<= y 1.35e-67) (* (/ x (- t z)) (/ -1.0 z)) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-75) {
tmp = (x / y) / (t - z);
} else if (y <= 1.35e-67) {
tmp = (x / (t - z)) * (-1.0 / z);
} else {
tmp = (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 (y <= (-1.9d-75)) then
tmp = (x / y) / (t - z)
else if (y <= 1.35d-67) then
tmp = (x / (t - z)) * ((-1.0d0) / z)
else
tmp = (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 (y <= -1.9e-75) {
tmp = (x / y) / (t - z);
} else if (y <= 1.35e-67) {
tmp = (x / (t - z)) * (-1.0 / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.9e-75: tmp = (x / y) / (t - z) elif y <= 1.35e-67: tmp = (x / (t - z)) * (-1.0 / z) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-75) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.35e-67) tmp = Float64(Float64(x / Float64(t - z)) * Float64(-1.0 / z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.9e-75) tmp = (x / y) / (t - z); elseif (y <= 1.35e-67) tmp = (x / (t - z)) * (-1.0 / z); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-75], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-67], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.89999999999999997e-75Initial program 89.1%
Taylor expanded in y around inf 77.4%
associate-/r*83.4%
Simplified83.4%
if -1.89999999999999997e-75 < y < 1.35000000000000008e-67Initial program 88.8%
associate-/l/98.7%
div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 84.1%
if 1.35000000000000008e-67 < y Initial program 87.8%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 56.1%
(FPCore (x y z t) :precision binary64 (if (<= t -1.3e-147) (/ (/ x y) (- t z)) (if (<= t 2e-37) (/ (/ x z) (- z y)) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.3e-147) {
tmp = (x / y) / (t - z);
} else if (t <= 2e-37) {
tmp = (x / z) / (z - y);
} else {
tmp = (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.3d-147)) then
tmp = (x / y) / (t - z)
else if (t <= 2d-37) then
tmp = (x / z) / (z - y)
else
tmp = (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.3e-147) {
tmp = (x / y) / (t - z);
} else if (t <= 2e-37) {
tmp = (x / z) / (z - y);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.3e-147: tmp = (x / y) / (t - z) elif t <= 2e-37: tmp = (x / z) / (z - y) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.3e-147) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 2e-37) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = 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.3e-147) tmp = (x / y) / (t - z); elseif (t <= 2e-37) tmp = (x / z) / (z - y); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.3e-147], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-37], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.2999999999999999e-147Initial program 90.0%
Taylor expanded in y around inf 53.3%
associate-/r*56.6%
Simplified56.6%
if -1.2999999999999999e-147 < t < 2.00000000000000013e-37Initial program 90.6%
Taylor expanded in t around 0 74.6%
mul-1-neg74.6%
associate-/r*81.8%
distribute-neg-frac281.8%
neg-sub081.8%
sub-neg81.8%
+-commutative81.8%
associate--r+81.8%
neg-sub081.8%
remove-double-neg81.8%
Simplified81.8%
if 2.00000000000000013e-37 < t Initial program 84.3%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in t around inf 88.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.32e-74) (/ (/ x y) (- t z)) (if (<= y 1.25e-295) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.32e-74) {
tmp = (x / y) / (t - z);
} else if (y <= 1.25e-295) {
tmp = (x / z) / (z - t);
} else {
tmp = (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 (y <= (-1.32d-74)) then
tmp = (x / y) / (t - z)
else if (y <= 1.25d-295) then
tmp = (x / z) / (z - t)
else
tmp = (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 (y <= -1.32e-74) {
tmp = (x / y) / (t - z);
} else if (y <= 1.25e-295) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.32e-74: tmp = (x / y) / (t - z) elif y <= 1.25e-295: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.32e-74) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.25e-295) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.32e-74) tmp = (x / y) / (t - z); elseif (y <= 1.25e-295) tmp = (x / z) / (z - t); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.32e-74], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-295], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-295}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.32e-74Initial program 89.1%
Taylor expanded in y around inf 77.4%
associate-/r*83.4%
Simplified83.4%
if -1.32e-74 < y < 1.25000000000000002e-295Initial program 90.1%
Taylor expanded in y around 0 79.6%
mul-1-neg79.6%
associate-/r*87.2%
distribute-neg-frac287.2%
sub-neg87.2%
+-commutative87.2%
distribute-neg-in87.2%
remove-double-neg87.2%
unsub-neg87.2%
Simplified87.2%
if 1.25000000000000002e-295 < y Initial program 87.6%
associate-/l/97.4%
Simplified97.4%
Taylor expanded in t around inf 60.6%
(FPCore (x y z t) :precision binary64 (if (<= t -6.5e-21) (/ (/ x t) y) (if (<= t 4.8e-100) (/ x (* z (- z y))) (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.5e-21) {
tmp = (x / t) / y;
} else if (t <= 4.8e-100) {
tmp = x / (z * (z - y));
} else {
tmp = (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 <= (-6.5d-21)) then
tmp = (x / t) / y
else if (t <= 4.8d-100) then
tmp = x / (z * (z - y))
else
tmp = (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 <= -6.5e-21) {
tmp = (x / t) / y;
} else if (t <= 4.8e-100) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.5e-21: tmp = (x / t) / y elif t <= 4.8e-100: tmp = x / (z * (z - y)) else: tmp = (x / t) / (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.5e-21) tmp = Float64(Float64(x / t) / y); elseif (t <= 4.8e-100) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -6.5e-21) tmp = (x / t) / y; elseif (t <= 4.8e-100) tmp = x / (z * (z - y)); else tmp = (x / t) / (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.5e-21], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 4.8e-100], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -6.49999999999999987e-21Initial program 89.1%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.6%
Taylor expanded in y around inf 61.2%
if -6.49999999999999987e-21 < t < 4.8000000000000005e-100Initial program 89.7%
Taylor expanded in t around 0 71.9%
mul-1-neg71.9%
distribute-rgt-neg-in71.9%
neg-sub071.9%
sub-neg71.9%
+-commutative71.9%
associate--r+71.9%
neg-sub071.9%
remove-double-neg71.9%
Simplified71.9%
if 4.8000000000000005e-100 < t Initial program 86.9%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in t around inf 84.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1.7e-18) (/ (/ x t) y) (if (<= t 6.2e-103) (/ x (* z (- z y))) (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-18) {
tmp = (x / t) / y;
} else if (t <= 6.2e-103) {
tmp = x / (z * (z - y));
} else {
tmp = 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.7d-18)) then
tmp = (x / t) / y
else if (t <= 6.2d-103) then
tmp = x / (z * (z - y))
else
tmp = 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.7e-18) {
tmp = (x / t) / y;
} else if (t <= 6.2e-103) {
tmp = x / (z * (z - y));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.7e-18: tmp = (x / t) / y elif t <= 6.2e-103: tmp = x / (z * (z - y)) else: tmp = x / ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.7e-18) tmp = Float64(Float64(x / t) / y); elseif (t <= 6.2e-103) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = 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.7e-18) tmp = (x / t) / y; elseif (t <= 6.2e-103) tmp = x / (z * (z - y)); else tmp = x / ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.7e-18], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 6.2e-103], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.70000000000000001e-18Initial program 89.1%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 83.6%
Taylor expanded in y around inf 61.2%
if -1.70000000000000001e-18 < t < 6.2000000000000003e-103Initial program 89.7%
Taylor expanded in t around 0 71.9%
mul-1-neg71.9%
distribute-rgt-neg-in71.9%
neg-sub071.9%
sub-neg71.9%
+-commutative71.9%
associate--r+71.9%
neg-sub071.9%
remove-double-neg71.9%
Simplified71.9%
if 6.2000000000000003e-103 < t Initial program 86.9%
Taylor expanded in t around inf 75.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.8e+45) (not (<= z 3.1e+71))) (/ (/ x z) z) (/ (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+45) || !(z <= 3.1e+71)) {
tmp = (x / z) / z;
} else {
tmp = (x / 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 <= (-4.8d+45)) .or. (.not. (z <= 3.1d+71))) then
tmp = (x / z) / z
else
tmp = (x / t) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.8e+45) || !(z <= 3.1e+71)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.8e+45) or not (z <= 3.1e+71): tmp = (x / z) / z else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.8e+45) || !(z <= 3.1e+71)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.8e+45) || ~((z <= 3.1e+71))) tmp = (x / z) / z; else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.8e+45], N[Not[LessEqual[z, 3.1e+71]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+45} \lor \neg \left(z \leq 3.1 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -4.79999999999999979e45 or 3.10000000000000018e71 < z Initial program 81.8%
Taylor expanded in t around 0 77.6%
mul-1-neg77.6%
distribute-rgt-neg-in77.6%
neg-sub077.6%
sub-neg77.6%
+-commutative77.6%
associate--r+77.6%
neg-sub077.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in z around inf 74.6%
associate-/r*84.2%
div-inv84.2%
Applied egg-rr84.2%
associate-*r/84.2%
*-rgt-identity84.2%
Simplified84.2%
if -4.79999999999999979e45 < z < 3.10000000000000018e71Initial program 92.0%
associate-/l/98.1%
Simplified98.1%
Taylor expanded in t around inf 74.7%
Taylor expanded in y around inf 56.8%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e+47) (not (<= z 2.8e+71))) (/ x (* z z)) (/ (/ x t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e+47) || !(z <= 2.8e+71)) {
tmp = x / (z * z);
} else {
tmp = (x / 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.1d+47)) .or. (.not. (z <= 2.8d+71))) then
tmp = x / (z * z)
else
tmp = (x / 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.1e+47) || !(z <= 2.8e+71)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1e+47) or not (z <= 2.8e+71): tmp = x / (z * z) else: tmp = (x / t) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e+47) || !(z <= 2.8e+71)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1e+47) || ~((z <= 2.8e+71))) tmp = x / (z * z); else tmp = (x / t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e+47], N[Not[LessEqual[z, 2.8e+71]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+47} \lor \neg \left(z \leq 2.8 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.1e47 or 2.80000000000000002e71 < z Initial program 81.8%
Taylor expanded in t around 0 77.6%
mul-1-neg77.6%
distribute-rgt-neg-in77.6%
neg-sub077.6%
sub-neg77.6%
+-commutative77.6%
associate--r+77.6%
neg-sub077.6%
remove-double-neg77.6%
Simplified77.6%
Taylor expanded in z around inf 74.6%
if -1.1e47 < z < 2.80000000000000002e71Initial program 92.0%
associate-/l/98.1%
Simplified98.1%
Taylor expanded in t around inf 74.7%
Taylor expanded in y around inf 56.8%
Final simplification62.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.8e+25) (not (<= z 2.8e+71))) (/ x (* z z)) (/ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e+25) || !(z <= 2.8e+71)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.8d+25)) .or. (.not. (z <= 2.8d+71))) then
tmp = x / (z * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e+25) || !(z <= 2.8e+71)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.8e+25) or not (z <= 2.8e+71): tmp = x / (z * z) else: tmp = x / (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.8e+25) || !(z <= 2.8e+71)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.8e+25) || ~((z <= 2.8e+71))) tmp = x / (z * z); else tmp = x / (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.8e+25], N[Not[LessEqual[z, 2.8e+71]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+25} \lor \neg \left(z \leq 2.8 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.80000000000000008e25 or 2.80000000000000002e71 < z Initial program 82.2%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
distribute-rgt-neg-in77.0%
neg-sub077.0%
sub-neg77.0%
+-commutative77.0%
associate--r+77.0%
neg-sub077.0%
remove-double-neg77.0%
Simplified77.0%
Taylor expanded in z around inf 74.1%
if -1.80000000000000008e25 < z < 2.80000000000000002e71Initial program 91.9%
Taylor expanded in z around 0 51.0%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1e+47) (not (<= z 5400.0))) (/ x (* y z)) (/ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1e+47) || !(z <= 5400.0)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1d+47)) .or. (.not. (z <= 5400.0d0))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1e+47) || !(z <= 5400.0)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1e+47) or not (z <= 5400.0): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1e+47) || !(z <= 5400.0)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1e+47) || ~((z <= 5400.0))) tmp = x / (y * z); else tmp = x / (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1e+47], N[Not[LessEqual[z, 5400.0]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+47} \lor \neg \left(z \leq 5400\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1e47 or 5400 < z Initial program 84.0%
Taylor expanded in t around 0 75.5%
mul-1-neg75.5%
distribute-rgt-neg-in75.5%
neg-sub075.5%
sub-neg75.5%
+-commutative75.5%
associate--r+75.5%
neg-sub075.5%
remove-double-neg75.5%
Simplified75.5%
Taylor expanded in z around 0 42.2%
associate-*r/42.2%
neg-mul-142.2%
*-commutative42.2%
Simplified42.2%
add-sqr-sqrt18.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod23.2%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
*-commutative39.5%
Applied egg-rr39.5%
*-lft-identity39.5%
*-commutative39.5%
Simplified39.5%
if -1e47 < z < 5400Initial program 91.4%
Taylor expanded in z around 0 51.6%
Final simplification47.0%
(FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
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 / (t - z)) / (y - z)
end function
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
def code(x, y, z, t): return (x / (t - z)) / (y - z)
function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
function tmp = code(x, y, z, t) tmp = (x / (t - z)) / (y - z); end
code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 88.6%
associate-/l/98.7%
Simplified98.7%
(FPCore (x y z t) :precision binary64 (/ x (* y t)))
double code(double x, double y, double z, double t) {
return x / (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 = x / (y * t)
end function
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
def code(x, y, z, t): return x / (y * t)
function code(x, y, z, t) return Float64(x / Float64(y * t)) end
function tmp = code(x, y, z, t) tmp = x / (y * t); end
code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 88.6%
Taylor expanded in z around 0 39.6%
Final simplification39.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / 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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024146
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))