
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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) * (z - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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) * (z - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (+ t (* (/ x y) (- z t))))
double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - 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 = t + ((x / y) * (z - t))
end function
public static double code(double x, double y, double z, double t) {
return t + ((x / y) * (z - t));
}
def code(x, y, z, t): return t + ((x / y) * (z - t))
function code(x, y, z, t) return Float64(t + Float64(Float64(x / y) * Float64(z - t))) end
function tmp = code(x, y, z, t) tmp = t + ((x / y) * (z - t)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{x}{y} \cdot \left(z - t\right)
\end{array}
Initial program 97.7%
Final simplification97.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)) (t_2 (* t (/ x (- y)))))
(if (<= (/ x y) -1e+237)
t_1
(if (<= (/ x y) -10000000.0)
t_2
(if (<= (/ x y) 2e-75)
t
(if (or (<= (/ x y) 2e+43)
(and (not (<= (/ x y) 2e+110)) (<= (/ x y) 5e+192)))
t_1
t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t * (x / -y);
double tmp;
if ((x / y) <= -1e+237) {
tmp = t_1;
} else if ((x / y) <= -10000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-75) {
tmp = t;
} else if (((x / y) <= 2e+43) || (!((x / y) <= 2e+110) && ((x / y) <= 5e+192))) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (x / y) * z
t_2 = t * (x / -y)
if ((x / y) <= (-1d+237)) then
tmp = t_1
else if ((x / y) <= (-10000000.0d0)) then
tmp = t_2
else if ((x / y) <= 2d-75) then
tmp = t
else if (((x / y) <= 2d+43) .or. (.not. ((x / y) <= 2d+110)) .and. ((x / y) <= 5d+192)) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t * (x / -y);
double tmp;
if ((x / y) <= -1e+237) {
tmp = t_1;
} else if ((x / y) <= -10000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-75) {
tmp = t;
} else if (((x / y) <= 2e+43) || (!((x / y) <= 2e+110) && ((x / y) <= 5e+192))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z t_2 = t * (x / -y) tmp = 0 if (x / y) <= -1e+237: tmp = t_1 elif (x / y) <= -10000000.0: tmp = t_2 elif (x / y) <= 2e-75: tmp = t elif ((x / y) <= 2e+43) or (not ((x / y) <= 2e+110) and ((x / y) <= 5e+192)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) t_2 = Float64(t * Float64(x / Float64(-y))) tmp = 0.0 if (Float64(x / y) <= -1e+237) tmp = t_1; elseif (Float64(x / y) <= -10000000.0) tmp = t_2; elseif (Float64(x / y) <= 2e-75) tmp = t; elseif ((Float64(x / y) <= 2e+43) || (!(Float64(x / y) <= 2e+110) && (Float64(x / y) <= 5e+192))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; t_2 = t * (x / -y); tmp = 0.0; if ((x / y) <= -1e+237) tmp = t_1; elseif ((x / y) <= -10000000.0) tmp = t_2; elseif ((x / y) <= 2e-75) tmp = t; elseif (((x / y) <= 2e+43) || (~(((x / y) <= 2e+110)) && ((x / y) <= 5e+192))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1e+237], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -10000000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 2e-75], t, If[Or[LessEqual[N[(x / y), $MachinePrecision], 2e+43], And[N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+110]], $MachinePrecision], LessEqual[N[(x / y), $MachinePrecision], 5e+192]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
t_2 := t \cdot \frac{x}{-y}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -10000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;t\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+43} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+110}\right) \land \frac{x}{y} \leq 5 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.9999999999999994e236 or 1.9999999999999999e-75 < (/.f64 x y) < 2.00000000000000003e43 or 2e110 < (/.f64 x y) < 5.00000000000000033e192Initial program 97.0%
Taylor expanded in z around inf 69.7%
*-commutative69.7%
associate-/l*74.8%
Applied egg-rr74.8%
if -9.9999999999999994e236 < (/.f64 x y) < -1e7 or 2.00000000000000003e43 < (/.f64 x y) < 2e110 or 5.00000000000000033e192 < (/.f64 x y) Initial program 97.2%
Taylor expanded in x around -inf 91.9%
Taylor expanded in z around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-in71.0%
Simplified71.0%
Taylor expanded in t around 0 71.0%
mul-1-neg71.0%
associate-*r/78.9%
distribute-rgt-neg-in78.9%
distribute-frac-neg278.9%
Simplified78.9%
if -1e7 < (/.f64 x y) < 1.9999999999999999e-75Initial program 98.4%
Taylor expanded in x around 0 80.5%
Final simplification78.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) z)) (t_2 (/ t (/ y (- x)))))
(if (<= (/ x y) -1e+237)
t_1
(if (<= (/ x y) -10000000.0)
t_2
(if (<= (/ x y) 2e-75)
t
(if (or (<= (/ x y) 2e+43)
(and (not (<= (/ x y) 2e+110)) (<= (/ x y) 5e+192)))
t_1
t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t / (y / -x);
double tmp;
if ((x / y) <= -1e+237) {
tmp = t_1;
} else if ((x / y) <= -10000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-75) {
tmp = t;
} else if (((x / y) <= 2e+43) || (!((x / y) <= 2e+110) && ((x / y) <= 5e+192))) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (x / y) * z
t_2 = t / (y / -x)
if ((x / y) <= (-1d+237)) then
tmp = t_1
else if ((x / y) <= (-10000000.0d0)) then
tmp = t_2
else if ((x / y) <= 2d-75) then
tmp = t
else if (((x / y) <= 2d+43) .or. (.not. ((x / y) <= 2d+110)) .and. ((x / y) <= 5d+192)) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double t_2 = t / (y / -x);
double tmp;
if ((x / y) <= -1e+237) {
tmp = t_1;
} else if ((x / y) <= -10000000.0) {
tmp = t_2;
} else if ((x / y) <= 2e-75) {
tmp = t;
} else if (((x / y) <= 2e+43) || (!((x / y) <= 2e+110) && ((x / y) <= 5e+192))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z t_2 = t / (y / -x) tmp = 0 if (x / y) <= -1e+237: tmp = t_1 elif (x / y) <= -10000000.0: tmp = t_2 elif (x / y) <= 2e-75: tmp = t elif ((x / y) <= 2e+43) or (not ((x / y) <= 2e+110) and ((x / y) <= 5e+192)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) t_2 = Float64(t / Float64(y / Float64(-x))) tmp = 0.0 if (Float64(x / y) <= -1e+237) tmp = t_1; elseif (Float64(x / y) <= -10000000.0) tmp = t_2; elseif (Float64(x / y) <= 2e-75) tmp = t; elseif ((Float64(x / y) <= 2e+43) || (!(Float64(x / y) <= 2e+110) && (Float64(x / y) <= 5e+192))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; t_2 = t / (y / -x); tmp = 0.0; if ((x / y) <= -1e+237) tmp = t_1; elseif ((x / y) <= -10000000.0) tmp = t_2; elseif ((x / y) <= 2e-75) tmp = t; elseif (((x / y) <= 2e+43) || (~(((x / y) <= 2e+110)) && ((x / y) <= 5e+192))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(y / (-x)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1e+237], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], -10000000.0], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 2e-75], t, If[Or[LessEqual[N[(x / y), $MachinePrecision], 2e+43], And[N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e+110]], $MachinePrecision], LessEqual[N[(x / y), $MachinePrecision], 5e+192]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
t_2 := \frac{t}{\frac{y}{-x}}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq -10000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{-75}:\\
\;\;\;\;t\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+43} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{+110}\right) \land \frac{x}{y} \leq 5 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.9999999999999994e236 or 1.9999999999999999e-75 < (/.f64 x y) < 2.00000000000000003e43 or 2e110 < (/.f64 x y) < 5.00000000000000033e192Initial program 97.0%
Taylor expanded in z around inf 69.7%
*-commutative69.7%
associate-/l*74.8%
Applied egg-rr74.8%
if -9.9999999999999994e236 < (/.f64 x y) < -1e7 or 2.00000000000000003e43 < (/.f64 x y) < 2e110 or 5.00000000000000033e192 < (/.f64 x y) Initial program 97.2%
Taylor expanded in x around -inf 91.9%
Taylor expanded in z around 0 71.0%
mul-1-neg71.0%
distribute-rgt-neg-in71.0%
Simplified71.0%
frac-2neg71.0%
distribute-frac-neg71.0%
associate-*r/78.9%
frac-2neg78.9%
clear-num78.8%
div-inv77.5%
Applied egg-rr77.5%
if -1e7 < (/.f64 x y) < 1.9999999999999999e-75Initial program 98.4%
Taylor expanded in x around 0 80.5%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e-24) (not (<= (/ x y) 2e-75))) (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e-24) || !((x / y) <= 2e-75)) {
tmp = (x / y) * (z - t);
} else {
tmp = 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 (((x / y) <= (-1d-24)) .or. (.not. ((x / y) <= 2d-75))) then
tmp = (x / y) * (z - t)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e-24) || !((x / y) <= 2e-75)) {
tmp = (x / y) * (z - t);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e-24) or not ((x / y) <= 2e-75): tmp = (x / y) * (z - t) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e-24) || !(Float64(x / y) <= 2e-75)) tmp = Float64(Float64(x / y) * Float64(z - t)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e-24) || ~(((x / y) <= 2e-75))) tmp = (x / y) * (z - t); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e-24], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-75]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{-24} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999924e-25 or 1.9999999999999999e-75 < (/.f64 x y) Initial program 97.2%
Taylor expanded in x around -inf 87.6%
*-commutative87.6%
associate-/l*91.9%
*-commutative91.9%
Applied egg-rr91.9%
if -9.99999999999999924e-25 < (/.f64 x y) < 1.9999999999999999e-75Initial program 98.3%
Taylor expanded in x around 0 83.2%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -10000000.0) (* (/ x y) (- z t)) (if (<= (/ x y) 0.04) (+ t (/ (* x z) y)) (* x (/ (- z t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -10000000.0) {
tmp = (x / y) * (z - t);
} else if ((x / y) <= 0.04) {
tmp = t + ((x * z) / y);
} else {
tmp = x * ((z - 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 ((x / y) <= (-10000000.0d0)) then
tmp = (x / y) * (z - t)
else if ((x / y) <= 0.04d0) then
tmp = t + ((x * z) / y)
else
tmp = x * ((z - t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -10000000.0) {
tmp = (x / y) * (z - t);
} else if ((x / y) <= 0.04) {
tmp = t + ((x * z) / y);
} else {
tmp = x * ((z - t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -10000000.0: tmp = (x / y) * (z - t) elif (x / y) <= 0.04: tmp = t + ((x * z) / y) else: tmp = x * ((z - t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -10000000.0) tmp = Float64(Float64(x / y) * Float64(z - t)); elseif (Float64(x / y) <= 0.04) tmp = Float64(t + Float64(Float64(x * z) / y)); else tmp = Float64(x * Float64(Float64(z - t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -10000000.0) tmp = (x / y) * (z - t); elseif ((x / y) <= 0.04) tmp = t + ((x * z) / y); else tmp = x * ((z - t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -10000000.0], N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.04], N[(t + N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10000000:\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{elif}\;\frac{x}{y} \leq 0.04:\\
\;\;\;\;t + \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -1e7Initial program 97.1%
Taylor expanded in x around -inf 91.4%
*-commutative91.4%
associate-/l*96.4%
*-commutative96.4%
Applied egg-rr96.4%
if -1e7 < (/.f64 x y) < 0.0400000000000000008Initial program 98.5%
Taylor expanded in z around inf 96.2%
if 0.0400000000000000008 < (/.f64 x y) Initial program 96.7%
Taylor expanded in x around -inf 92.5%
associate-/l*96.7%
*-commutative96.7%
Applied egg-rr96.7%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -1e-24) (not (<= (/ x y) 2e-75))) (* (/ x y) z) t))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e-24) || !((x / y) <= 2e-75)) {
tmp = (x / y) * z;
} else {
tmp = 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 (((x / y) <= (-1d-24)) .or. (.not. ((x / y) <= 2d-75))) then
tmp = (x / y) * z
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -1e-24) || !((x / y) <= 2e-75)) {
tmp = (x / y) * z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -1e-24) or not ((x / y) <= 2e-75): tmp = (x / y) * z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -1e-24) || !(Float64(x / y) <= 2e-75)) tmp = Float64(Float64(x / y) * z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -1e-24) || ~(((x / y) <= 2e-75))) tmp = (x / y) * z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -1e-24], N[Not[LessEqual[N[(x / y), $MachinePrecision], 2e-75]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{-24} \lor \neg \left(\frac{x}{y} \leq 2 \cdot 10^{-75}\right):\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if (/.f64 x y) < -9.99999999999999924e-25 or 1.9999999999999999e-75 < (/.f64 x y) Initial program 97.2%
Taylor expanded in z around inf 51.6%
*-commutative51.6%
associate-/l*55.3%
Applied egg-rr55.3%
if -9.99999999999999924e-25 < (/.f64 x y) < 1.9999999999999999e-75Initial program 98.3%
Taylor expanded in x around 0 83.2%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return 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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.7%
Taylor expanded in x around 0 40.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} 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) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + t
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) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024097
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))