
(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(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 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(Float64(x * 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[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(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(x / Float64(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[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
Initial program 85.9%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around 0 85.9%
*-rgt-identity85.9%
times-frac79.0%
/-rgt-identity79.0%
associate-/r/97.2%
Simplified97.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.7e+127)
(* x (+ 1.0 (/ -1.0 (/ z y))))
(if (<= z -7.8e-52)
(* x (/ z (- z t)))
(if (<= z -2.4e-244)
(/ (* x y) (- t z))
(if (<= z 5.2e+63) (* y (/ x (- t z))) (* x (- 1.0 (/ y z))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+127) {
tmp = x * (1.0 + (-1.0 / (z / y)));
} else if (z <= -7.8e-52) {
tmp = x * (z / (z - t));
} else if (z <= -2.4e-244) {
tmp = (x * y) / (t - z);
} else if (z <= 5.2e+63) {
tmp = y * (x / (t - z));
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.7d+127)) then
tmp = x * (1.0d0 + ((-1.0d0) / (z / y)))
else if (z <= (-7.8d-52)) then
tmp = x * (z / (z - t))
else if (z <= (-2.4d-244)) then
tmp = (x * y) / (t - z)
else if (z <= 5.2d+63) then
tmp = y * (x / (t - z))
else
tmp = x * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.7e+127) {
tmp = x * (1.0 + (-1.0 / (z / y)));
} else if (z <= -7.8e-52) {
tmp = x * (z / (z - t));
} else if (z <= -2.4e-244) {
tmp = (x * y) / (t - z);
} else if (z <= 5.2e+63) {
tmp = y * (x / (t - z));
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.7e+127: tmp = x * (1.0 + (-1.0 / (z / y))) elif z <= -7.8e-52: tmp = x * (z / (z - t)) elif z <= -2.4e-244: tmp = (x * y) / (t - z) elif z <= 5.2e+63: tmp = y * (x / (t - z)) else: tmp = x * (1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.7e+127) tmp = Float64(x * Float64(1.0 + Float64(-1.0 / Float64(z / y)))); elseif (z <= -7.8e-52) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= -2.4e-244) tmp = Float64(Float64(x * y) / Float64(t - z)); elseif (z <= 5.2e+63) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = Float64(x * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.7e+127) tmp = x * (1.0 + (-1.0 / (z / y))); elseif (z <= -7.8e-52) tmp = x * (z / (z - t)); elseif (z <= -2.4e-244) tmp = (x * y) / (t - z); elseif (z <= 5.2e+63) tmp = y * (x / (t - z)); else tmp = x * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+127], N[(x * N[(1.0 + N[(-1.0 / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.8e-52], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-244], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+63], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+127}:\\
\;\;\;\;x \cdot \left(1 + \frac{-1}{\frac{z}{y}}\right)\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-52}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-244}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+63}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -1.69999999999999989e127Initial program 72.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 63.2%
mul-1-neg63.2%
associate-/l*86.5%
distribute-rgt-neg-in86.5%
distribute-frac-neg86.5%
sub-neg86.5%
distribute-neg-in86.5%
remove-double-neg86.5%
+-commutative86.5%
sub-neg86.5%
div-sub86.5%
*-inverses86.5%
Simplified86.5%
clear-num86.5%
inv-pow86.5%
Applied egg-rr86.5%
unpow-186.5%
Simplified86.5%
if -1.69999999999999989e127 < z < -7.80000000000000036e-52Initial program 91.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 73.1%
mul-1-neg73.1%
distribute-neg-frac273.1%
sub-neg73.1%
distribute-neg-in73.1%
remove-double-neg73.1%
+-commutative73.1%
sub-neg73.1%
associate-/l*78.8%
Simplified78.8%
if -7.80000000000000036e-52 < z < -2.40000000000000016e-244Initial program 98.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in y around inf 87.3%
if -2.40000000000000016e-244 < z < 5.2000000000000002e63Initial program 92.2%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around 0 92.2%
*-rgt-identity92.2%
times-frac96.5%
/-rgt-identity96.5%
associate-/r/93.2%
Simplified93.2%
Taylor expanded in y around inf 75.1%
associate-*l/80.5%
*-commutative80.5%
Simplified80.5%
if 5.2000000000000002e63 < z Initial program 74.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 63.4%
mul-1-neg63.4%
associate-/l*88.4%
distribute-rgt-neg-in88.4%
distribute-frac-neg88.4%
sub-neg88.4%
distribute-neg-in88.4%
remove-double-neg88.4%
+-commutative88.4%
sub-neg88.4%
div-sub88.4%
*-inverses88.4%
Simplified88.4%
Final simplification84.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -1.75e+127)
t_1
(if (<= z -2.95e-50)
(* x (/ z (- z t)))
(if (<= z 5.4e+63) (* x (/ y (- t z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.75e+127) {
tmp = t_1;
} else if (z <= -2.95e-50) {
tmp = x * (z / (z - t));
} else if (z <= 5.4e+63) {
tmp = x * (y / (t - z));
} 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 * (1.0d0 - (y / z))
if (z <= (-1.75d+127)) then
tmp = t_1
else if (z <= (-2.95d-50)) then
tmp = x * (z / (z - t))
else if (z <= 5.4d+63) then
tmp = x * (y / (t - z))
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 * (1.0 - (y / z));
double tmp;
if (z <= -1.75e+127) {
tmp = t_1;
} else if (z <= -2.95e-50) {
tmp = x * (z / (z - t));
} else if (z <= 5.4e+63) {
tmp = x * (y / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.75e+127: tmp = t_1 elif z <= -2.95e-50: tmp = x * (z / (z - t)) elif z <= 5.4e+63: tmp = x * (y / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.75e+127) tmp = t_1; elseif (z <= -2.95e-50) tmp = Float64(x * Float64(z / Float64(z - t))); elseif (z <= 5.4e+63) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.75e+127) tmp = t_1; elseif (z <= -2.95e-50) tmp = x * (z / (z - t)); elseif (z <= 5.4e+63) tmp = x * (y / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+127], t$95$1, If[LessEqual[z, -2.95e-50], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+63], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.95 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.74999999999999989e127 or 5.40000000000000035e63 < z Initial program 73.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 63.3%
mul-1-neg63.3%
associate-/l*87.5%
distribute-rgt-neg-in87.5%
distribute-frac-neg87.5%
sub-neg87.5%
distribute-neg-in87.5%
remove-double-neg87.5%
+-commutative87.5%
sub-neg87.5%
div-sub87.5%
*-inverses87.5%
Simplified87.5%
if -1.74999999999999989e127 < z < -2.95e-50Initial program 91.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 73.1%
mul-1-neg73.1%
distribute-neg-frac273.1%
sub-neg73.1%
distribute-neg-in73.1%
remove-double-neg73.1%
+-commutative73.1%
sub-neg73.1%
associate-/l*78.8%
Simplified78.8%
if -2.95e-50 < z < 5.40000000000000035e63Initial program 94.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 78.9%
associate-/l*79.2%
Simplified79.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.8e+34) (not (<= t 3.3e-18))) (* x (/ (- y z) t)) (* x (- 1.0 (/ y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.8e+34) || !(t <= 3.3e-18)) {
tmp = x * ((y - z) / t);
} else {
tmp = x * (1.0 - (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 <= (-7.8d+34)) .or. (.not. (t <= 3.3d-18))) then
tmp = x * ((y - z) / t)
else
tmp = x * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.8e+34) || !(t <= 3.3e-18)) {
tmp = x * ((y - z) / t);
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.8e+34) or not (t <= 3.3e-18): tmp = x * ((y - z) / t) else: tmp = x * (1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.8e+34) || !(t <= 3.3e-18)) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = Float64(x * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.8e+34) || ~((t <= 3.3e-18))) tmp = x * ((y - z) / t); else tmp = x * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.8e+34], N[Not[LessEqual[t, 3.3e-18]], $MachinePrecision]], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+34} \lor \neg \left(t \leq 3.3 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if t < -7.80000000000000038e34 or 3.3000000000000002e-18 < t Initial program 86.4%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 71.4%
associate-/l*78.2%
Simplified78.2%
if -7.80000000000000038e34 < t < 3.3000000000000002e-18Initial program 85.6%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in t around 0 71.8%
mul-1-neg71.8%
associate-/l*83.0%
distribute-rgt-neg-in83.0%
distribute-frac-neg83.0%
sub-neg83.0%
distribute-neg-in83.0%
remove-double-neg83.0%
+-commutative83.0%
sub-neg83.0%
div-sub83.0%
*-inverses83.0%
Simplified83.0%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e-50) (not (<= z 5.8e+63))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-50) || !(z <= 5.8e+63)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.1d-50)) .or. (.not. (z <= 5.8d+63))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-50) || !(z <= 5.8e+63)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1e-50) or not (z <= 5.8e+63): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e-50) || !(z <= 5.8e+63)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1e-50) || ~((z <= 5.8e+63))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e-50], N[Not[LessEqual[z, 5.8e+63]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-50} \lor \neg \left(z \leq 5.8 \cdot 10^{+63}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.0999999999999999e-50 or 5.7999999999999999e63 < z Initial program 78.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 62.4%
mul-1-neg62.4%
associate-/l*80.5%
distribute-rgt-neg-in80.5%
distribute-frac-neg80.5%
sub-neg80.5%
distribute-neg-in80.5%
remove-double-neg80.5%
+-commutative80.5%
sub-neg80.5%
div-sub80.5%
*-inverses80.5%
Simplified80.5%
if -1.0999999999999999e-50 < z < 5.7999999999999999e63Initial program 94.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 78.9%
associate-/l*79.2%
Simplified79.2%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (<= t -2.1e+32) (* x (/ y t)) (if (<= t 3.6e-20) (* x (- 1.0 (/ y z))) (/ x (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e+32) {
tmp = x * (y / t);
} else if (t <= 3.6e-20) {
tmp = x * (1.0 - (y / 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 (t <= (-2.1d+32)) then
tmp = x * (y / t)
else if (t <= 3.6d-20) then
tmp = x * (1.0d0 - (y / 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 (t <= -2.1e+32) {
tmp = x * (y / t);
} else if (t <= 3.6e-20) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.1e+32: tmp = x * (y / t) elif t <= 3.6e-20: tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.1e+32) tmp = Float64(x * Float64(y / t)); elseif (t <= 3.6e-20) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.1e+32) tmp = x * (y / t); elseif (t <= 3.6e-20) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.1e+32], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-20], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-20}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -2.1000000000000001e32Initial program 88.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 70.4%
associate-/l*80.0%
Simplified80.0%
if -2.1000000000000001e32 < t < 3.59999999999999974e-20Initial program 85.6%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in t around 0 71.8%
mul-1-neg71.8%
associate-/l*83.0%
distribute-rgt-neg-in83.0%
distribute-frac-neg83.0%
sub-neg83.0%
distribute-neg-in83.0%
remove-double-neg83.0%
+-commutative83.0%
sub-neg83.0%
div-sub83.0%
*-inverses83.0%
Simplified83.0%
if 3.59999999999999974e-20 < t Initial program 84.9%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in x around 0 84.9%
*-rgt-identity84.9%
times-frac69.4%
/-rgt-identity69.4%
associate-/r/98.4%
Simplified98.4%
Taylor expanded in z around 0 53.7%
(FPCore (x y z t) :precision binary64 (if (<= z -7.4e-50) x (if (<= z 5e+63) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.4e-50) {
tmp = x;
} else if (z <= 5e+63) {
tmp = x * (y / t);
} else {
tmp = 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 (z <= (-7.4d-50)) then
tmp = x
else if (z <= 5d+63) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.4e-50) {
tmp = x;
} else if (z <= 5e+63) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.4e-50: tmp = x elif z <= 5e+63: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.4e-50) tmp = x; elseif (z <= 5e+63) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.4e-50) tmp = x; elseif (z <= 5e+63) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.4e-50], x, If[LessEqual[z, 5e+63], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-50}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.4000000000000002e-50 or 5.00000000000000011e63 < z Initial program 78.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 65.1%
if -7.4000000000000002e-50 < z < 5.00000000000000011e63Initial program 94.1%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in z around 0 62.0%
associate-/l*64.2%
Simplified64.2%
(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}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 85.9%
associate-/l*97.2%
Simplified97.2%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.9%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 39.3%
(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(x / Float64(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[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))