
(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 14 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 87.1%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.5%
Applied egg-rr96.5%
(FPCore (x y z t) :precision binary64 (if (<= t -4e+114) (/ x (/ t (- y z))) (if (<= t 1.4e+203) (* (- y z) (/ x (- t z))) (* x (/ (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4e+114) {
tmp = x / (t / (y - z));
} else if (t <= 1.4e+203) {
tmp = (y - z) * (x / (t - z));
} 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 <= (-4d+114)) then
tmp = x / (t / (y - z))
else if (t <= 1.4d+203) then
tmp = (y - z) * (x / (t - z))
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 <= -4e+114) {
tmp = x / (t / (y - z));
} else if (t <= 1.4e+203) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4e+114: tmp = x / (t / (y - z)) elif t <= 1.4e+203: tmp = (y - z) * (x / (t - z)) else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4e+114) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= 1.4e+203) tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); 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 <= -4e+114) tmp = x / (t / (y - z)); elseif (t <= 1.4e+203) tmp = (y - z) * (x / (t - z)); else tmp = x * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4e+114], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+203], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+114}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+203}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if t < -4e114Initial program 95.5%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.7%
Applied egg-rr97.7%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f6495.5%
Simplified95.5%
if -4e114 < t < 1.39999999999999995e203Initial program 87.1%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6486.5%
Applied egg-rr86.5%
if 1.39999999999999995e203 < t Initial program 72.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f6495.9%
Simplified95.9%
Final simplification89.0%
(FPCore (x y z t) :precision binary64 (if (<= z -3.5e-48) (* x (- 1.0 (/ y z))) (if (<= z 5.2e-24) (/ (* x y) (- t z)) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-48) {
tmp = x * (1.0 - (y / z));
} else if (z <= 5.2e-24) {
tmp = (x * y) / (t - z);
} else {
tmp = x * (z / (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 (z <= (-3.5d-48)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 5.2d-24) then
tmp = (x * y) / (t - z)
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.5e-48) {
tmp = x * (1.0 - (y / z));
} else if (z <= 5.2e-24) {
tmp = (x * y) / (t - z);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.5e-48: tmp = x * (1.0 - (y / z)) elif z <= 5.2e-24: tmp = (x * y) / (t - z) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.5e-48) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 5.2e-24) tmp = Float64(Float64(x * y) / Float64(t - z)); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.5e-48) tmp = x * (1.0 - (y / z)); elseif (z <= 5.2e-24) tmp = (x * y) / (t - z); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e-48], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-24], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-24}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -3.49999999999999991e-48Initial program 81.5%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6466.8%
Simplified66.8%
if -3.49999999999999991e-48 < z < 5.2e-24Initial program 97.2%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6487.1%
Simplified87.1%
if 5.2e-24 < z Initial program 73.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
--lowering--.f6457.5%
Simplified57.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6481.4%
Applied egg-rr81.4%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= z -9.2e+59) (* x (- 1.0 (/ y z))) (if (<= z 3.6) (/ x (/ t (- y z))) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.2e+59) {
tmp = x * (1.0 - (y / z));
} else if (z <= 3.6) {
tmp = x / (t / (y - z));
} else {
tmp = x * (z / (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 (z <= (-9.2d+59)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 3.6d0) then
tmp = x / (t / (y - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.2e+59) {
tmp = x * (1.0 - (y / z));
} else if (z <= 3.6) {
tmp = x / (t / (y - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.2e+59: tmp = x * (1.0 - (y / z)) elif z <= 3.6: tmp = x / (t / (y - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.2e+59) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 3.6) tmp = Float64(x / Float64(t / Float64(y - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9.2e+59) tmp = x * (1.0 - (y / z)); elseif (z <= 3.6) tmp = x / (t / (y - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.2e+59], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 3.6:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -9.20000000000000032e59Initial program 75.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6477.4%
Simplified77.4%
if -9.20000000000000032e59 < z < 3.60000000000000009Initial program 96.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3%
Applied egg-rr94.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
--lowering--.f6476.6%
Simplified76.6%
if 3.60000000000000009 < z Initial program 71.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
--lowering--.f6457.1%
Simplified57.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6482.7%
Applied egg-rr82.7%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e+66) (* x (- 1.0 (/ y z))) (if (<= z 1.1e-23) (* x (/ y (- t z))) (* x (/ z (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+66) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.1e-23) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (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 (z <= (-1.35d+66)) then
tmp = x * (1.0d0 - (y / z))
else if (z <= 1.1d-23) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+66) {
tmp = x * (1.0 - (y / z));
} else if (z <= 1.1e-23) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+66: tmp = x * (1.0 - (y / z)) elif z <= 1.1e-23: tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+66) tmp = Float64(x * Float64(1.0 - Float64(y / z))); elseif (z <= 1.1e-23) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e+66) tmp = x * (1.0 - (y / z)); elseif (z <= 1.1e-23) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+66], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-23], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+66}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -1.35e66Initial program 74.5%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6476.3%
Simplified76.3%
if -1.35e66 < z < 1.1e-23Initial program 96.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6480.5%
Simplified80.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6477.2%
Applied egg-rr77.2%
if 1.1e-23 < z Initial program 73.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
--lowering--.f6457.5%
Simplified57.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6481.4%
Applied egg-rr81.4%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -5.8e+65) t_1 (if (<= z 3.6) (* 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 <= -5.8e+65) {
tmp = t_1;
} else if (z <= 3.6) {
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 <= (-5.8d+65)) then
tmp = t_1
else if (z <= 3.6d0) 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 <= -5.8e+65) {
tmp = t_1;
} else if (z <= 3.6) {
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 <= -5.8e+65: tmp = t_1 elif z <= 3.6: 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 <= -5.8e+65) tmp = t_1; elseif (z <= 3.6) 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 <= -5.8e+65) tmp = t_1; elseif (z <= 3.6) 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, -5.8e+65], t$95$1, If[LessEqual[z, 3.6], 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 -5.8 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.6:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.8000000000000001e65 or 3.60000000000000009 < z Initial program 72.5%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6474.7%
Simplified74.7%
if -5.8000000000000001e65 < z < 3.60000000000000009Initial program 96.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6479.2%
Simplified79.2%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6475.9%
Applied egg-rr75.9%
Final simplification75.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -2.35e+59) t_1 (if (<= z 3.1) (* (- y z) (/ x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -2.35e+59) {
tmp = t_1;
} else if (z <= 3.1) {
tmp = (y - z) * (x / 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 * (1.0d0 - (y / z))
if (z <= (-2.35d+59)) then
tmp = t_1
else if (z <= 3.1d0) then
tmp = (y - z) * (x / 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 * (1.0 - (y / z));
double tmp;
if (z <= -2.35e+59) {
tmp = t_1;
} else if (z <= 3.1) {
tmp = (y - z) * (x / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -2.35e+59: tmp = t_1 elif z <= 3.1: tmp = (y - z) * (x / t) 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 <= -2.35e+59) tmp = t_1; elseif (z <= 3.1) tmp = Float64(Float64(y - z) * Float64(x / t)); 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 <= -2.35e+59) tmp = t_1; elseif (z <= 3.1) tmp = (y - z) * (x / t); 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, -2.35e+59], t$95$1, If[LessEqual[z, 3.1], N[(N[(y - z), $MachinePrecision] * N[(x / t), $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 -2.35 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.1:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.35e59 or 3.10000000000000009 < z Initial program 73.1%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6475.2%
Simplified75.2%
if -2.35e59 < z < 3.10000000000000009Initial program 96.4%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6473.2%
Simplified73.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -1.05e-49) t_1 (if (<= z 3.15) (/ (* x y) t) 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.05e-49) {
tmp = t_1;
} else if (z <= 3.15) {
tmp = (x * 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 * (1.0d0 - (y / z))
if (z <= (-1.05d-49)) then
tmp = t_1
else if (z <= 3.15d0) then
tmp = (x * 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 * (1.0 - (y / z));
double tmp;
if (z <= -1.05e-49) {
tmp = t_1;
} else if (z <= 3.15) {
tmp = (x * y) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.05e-49: tmp = t_1 elif z <= 3.15: tmp = (x * y) / t 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.05e-49) tmp = t_1; elseif (z <= 3.15) tmp = Float64(Float64(x * y) / t); 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.05e-49) tmp = t_1; elseif (z <= 3.15) tmp = (x * y) / t; 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.05e-49], t$95$1, If[LessEqual[z, 3.15], N[(N[(x * y), $MachinePrecision] / t), $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.05 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.15:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0499999999999999e-49 or 3.14999999999999991 < z Initial program 76.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-sub0N/A
div-subN/A
*-inversesN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6470.0%
Simplified70.0%
if -1.0499999999999999e-49 < z < 3.14999999999999991Initial program 97.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6473.5%
Simplified73.5%
(FPCore (x y z t) :precision binary64 (if (<= z -7e-48) x (if (<= z 3.2) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7e-48) {
tmp = x;
} else if (z <= 3.2) {
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 <= (-7d-48)) then
tmp = x
else if (z <= 3.2d0) 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 <= -7e-48) {
tmp = x;
} else if (z <= 3.2) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7e-48: tmp = x elif z <= 3.2: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7e-48) tmp = x; elseif (z <= 3.2) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7e-48) tmp = x; elseif (z <= 3.2) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7e-48], x, If[LessEqual[z, 3.2], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-48}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.2:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.99999999999999982e-48 or 3.2000000000000002 < z Initial program 76.7%
Taylor expanded in z around inf
Simplified55.1%
if -6.99999999999999982e-48 < z < 3.2000000000000002Initial program 97.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6473.5%
Simplified73.5%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e+59) x (if (<= z 3.5) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e+59) {
tmp = x;
} else if (z <= 3.5) {
tmp = x / (t / y);
} 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 <= (-3.8d+59)) then
tmp = x
else if (z <= 3.5d0) then
tmp = x / (t / y)
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 <= -3.8e+59) {
tmp = x;
} else if (z <= 3.5) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e+59: tmp = x elif z <= 3.5: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e+59) tmp = x; elseif (z <= 3.5) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.8e+59) tmp = x; elseif (z <= 3.5) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e+59], x, If[LessEqual[z, 3.5], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000001e59 or 3.5 < z Initial program 73.1%
Taylor expanded in z around inf
Simplified62.1%
if -3.8000000000000001e59 < z < 3.5Initial program 96.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3%
Applied egg-rr94.3%
Taylor expanded in z around 0
/-lowering-/.f6465.1%
Simplified65.1%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e+59) x (if (<= z 3.3) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+59) {
tmp = x;
} else if (z <= 3.3) {
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 <= (-2.2d+59)) then
tmp = x
else if (z <= 3.3d0) 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 <= -2.2e+59) {
tmp = x;
} else if (z <= 3.3) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+59: tmp = x elif z <= 3.3: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+59) tmp = x; elseif (z <= 3.3) 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 <= -2.2e+59) tmp = x; elseif (z <= 3.3) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+59], x, If[LessEqual[z, 3.3], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.2e59 or 3.2999999999999998 < z Initial program 73.1%
Taylor expanded in z around inf
Simplified62.1%
if -2.2e59 < z < 3.2999999999999998Initial program 96.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3%
Applied egg-rr94.3%
Taylor expanded in z around 0
/-lowering-/.f6465.1%
Simplified65.1%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f6464.8%
Applied egg-rr64.8%
Final simplification63.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e+59) x (if (<= z 3.5) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+59) {
tmp = x;
} else if (z <= 3.5) {
tmp = y * (x / 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 <= (-1.8d+59)) then
tmp = x
else if (z <= 3.5d0) then
tmp = y * (x / 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 <= -1.8e+59) {
tmp = x;
} else if (z <= 3.5) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e+59: tmp = x elif z <= 3.5: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e+59) tmp = x; elseif (z <= 3.5) tmp = Float64(y * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e+59) tmp = x; elseif (z <= 3.5) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e+59], x, If[LessEqual[z, 3.5], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.7999999999999999e59 or 3.5 < z Initial program 73.1%
Taylor expanded in z around inf
Simplified62.1%
if -1.7999999999999999e59 < z < 3.5Initial program 96.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.3%
Applied egg-rr94.3%
Taylor expanded in z around 0
/-lowering-/.f6465.1%
Simplified65.1%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6462.7%
Applied egg-rr62.7%
Final simplification62.5%
(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 87.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6496.2%
Applied egg-rr96.2%
Final simplification96.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 87.1%
Taylor expanded in z around inf
Simplified31.4%
(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 2024138
(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)))