
(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 11 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
(let* ((t_1 (* (/ (- y z) (- t z)) x)))
(if (<= z -1.35e-146)
t_1
(if (<= z 2.1e-123) (/ (* (- y z) x) (- t z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((y - z) / (t - z)) * x;
double tmp;
if (z <= -1.35e-146) {
tmp = t_1;
} else if (z <= 2.1e-123) {
tmp = ((y - z) * x) / (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 = ((y - z) / (t - z)) * x
if (z <= (-1.35d-146)) then
tmp = t_1
else if (z <= 2.1d-123) then
tmp = ((y - z) * x) / (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 = ((y - z) / (t - z)) * x;
double tmp;
if (z <= -1.35e-146) {
tmp = t_1;
} else if (z <= 2.1e-123) {
tmp = ((y - z) * x) / (t - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((y - z) / (t - z)) * x tmp = 0 if z <= -1.35e-146: tmp = t_1 elif z <= 2.1e-123: tmp = ((y - z) * x) / (t - z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y - z) / Float64(t - z)) * x) tmp = 0.0 if (z <= -1.35e-146) tmp = t_1; elseif (z <= 2.1e-123) tmp = Float64(Float64(Float64(y - z) * x) / Float64(t - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((y - z) / (t - z)) * x; tmp = 0.0; if (z <= -1.35e-146) tmp = t_1; elseif (z <= 2.1e-123) tmp = ((y - z) * x) / (t - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -1.35e-146], t$95$1, If[LessEqual[z, 2.1e-123], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{t - z} \cdot x\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-123}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.34999999999999997e-146 or 2.0999999999999999e-123 < z Initial program 79.9%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
if -1.34999999999999997e-146 < z < 2.0999999999999999e-123Initial program 98.0%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.5e-12)
(fma (- 0.0 (/ y z)) x x)
(if (<= z 5.2e-169)
(/ (* (- y z) x) t)
(if (<= z 350.0) (* y (/ x (- t z))) (* x (- 1.0 (/ y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5e-12) {
tmp = fma((0.0 - (y / z)), x, x);
} else if (z <= 5.2e-169) {
tmp = ((y - z) * x) / t;
} else if (z <= 350.0) {
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 <= -4.5e-12) tmp = fma(Float64(0.0 - Float64(y / z)), x, x); elseif (z <= 5.2e-169) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (z <= 350.0) tmp = Float64(y * Float64(x / Float64(t - z))); else tmp = Float64(x * Float64(1.0 - Float64(y / z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5e-12], N[(N[(0.0 - N[(y / z), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[z, 5.2e-169], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 350.0], 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 -4.5 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(0 - \frac{y}{z}, x, x\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-169}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;z \leq 350:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -4.49999999999999981e-12Initial program 80.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-/.f6480.1%
Simplified80.1%
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6480.1%
Applied egg-rr80.1%
sub0-negN/A
neg-lowering-neg.f6480.1%
Applied egg-rr80.1%
if -4.49999999999999981e-12 < z < 5.20000000000000028e-169Initial program 98.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6486.7%
Simplified86.7%
if 5.20000000000000028e-169 < z < 350Initial program 88.3%
div-invN/A
*-commutativeN/A
flip3--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip3--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.2%
Applied egg-rr88.2%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
*-commutativeN/A
associate-*r*N/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.5%
Applied egg-rr74.5%
if 350 < z Initial program 68.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-/.f6490.3%
Simplified90.3%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -4.8e-13)
t_1
(if (<= z 1.2e-167)
(/ (* (- y z) x) t)
(if (<= z 390.0) (* y (/ x (- 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 <= -4.8e-13) {
tmp = t_1;
} else if (z <= 1.2e-167) {
tmp = ((y - z) * x) / t;
} else if (z <= 390.0) {
tmp = y * (x / (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 <= (-4.8d-13)) then
tmp = t_1
else if (z <= 1.2d-167) then
tmp = ((y - z) * x) / t
else if (z <= 390.0d0) then
tmp = y * (x / (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 <= -4.8e-13) {
tmp = t_1;
} else if (z <= 1.2e-167) {
tmp = ((y - z) * x) / t;
} else if (z <= 390.0) {
tmp = y * (x / (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 <= -4.8e-13: tmp = t_1 elif z <= 1.2e-167: tmp = ((y - z) * x) / t elif z <= 390.0: tmp = y * (x / (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 <= -4.8e-13) tmp = t_1; elseif (z <= 1.2e-167) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (z <= 390.0) tmp = Float64(y * Float64(x / 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 <= -4.8e-13) tmp = t_1; elseif (z <= 1.2e-167) tmp = ((y - z) * x) / t; elseif (z <= 390.0) tmp = y * (x / (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, -4.8e-13], t$95$1, If[LessEqual[z, 1.2e-167], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 390.0], N[(y * N[(x / 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 -4.8 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-167}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;z \leq 390:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.7999999999999997e-13 or 390 < z Initial program 74.4%
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-/.f6485.4%
Simplified85.4%
if -4.7999999999999997e-13 < z < 1.19999999999999997e-167Initial program 98.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6486.7%
Simplified86.7%
if 1.19999999999999997e-167 < z < 390Initial program 88.3%
div-invN/A
*-commutativeN/A
flip3--N/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
flip3--N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.2%
Applied egg-rr88.2%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6470.0%
Simplified70.0%
*-commutativeN/A
associate-*r*N/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6474.5%
Applied egg-rr74.5%
Final simplification84.2%
(FPCore (x y z t) :precision binary64 (if (<= z -4.2e+121) (* x (+ 1.0 (/ (- t y) z))) (if (<= z 1.18e+88) (* (- y z) (/ x (- t z))) (* x (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.2e+121) {
tmp = x * (1.0 + ((t - y) / z));
} else if (z <= 1.18e+88) {
tmp = (y - z) * (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 <= (-4.2d+121)) then
tmp = x * (1.0d0 + ((t - y) / z))
else if (z <= 1.18d+88) then
tmp = (y - z) * (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 <= -4.2e+121) {
tmp = x * (1.0 + ((t - y) / z));
} else if (z <= 1.18e+88) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.2e+121: tmp = x * (1.0 + ((t - y) / z)) elif z <= 1.18e+88: tmp = (y - z) * (x / (t - z)) else: tmp = x * (1.0 - (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.2e+121) tmp = Float64(x * Float64(1.0 + Float64(Float64(t - y) / z))); elseif (z <= 1.18e+88) tmp = Float64(Float64(y - z) * 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 <= -4.2e+121) tmp = x * (1.0 + ((t - y) / z)); elseif (z <= 1.18e+88) tmp = (y - z) * (x / (t - z)); else tmp = x * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.2e+121], N[(x * N[(1.0 + N[(N[(t - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e+88], N[(N[(y - z), $MachinePrecision] * 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 -4.2 \cdot 10^{+121}:\\
\;\;\;\;x \cdot \left(1 + \frac{t - y}{z}\right)\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{+88}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if z < -4.2000000000000003e121Initial program 64.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around inf
mul-1-negN/A
sub-negN/A
associate--l-N/A
mul-1-negN/A
sub-negN/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6495.8%
Simplified95.8%
if -4.2000000000000003e121 < z < 1.1799999999999999e88Initial program 95.0%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.1%
Applied egg-rr92.1%
if 1.1799999999999999e88 < z Initial program 56.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-/.f6491.5%
Simplified91.5%
Final simplification92.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -7.5e-9) t_1 (if (<= z 360.0) (/ (* y x) (- 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 <= -7.5e-9) {
tmp = t_1;
} else if (z <= 360.0) {
tmp = (y * x) / (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 <= (-7.5d-9)) then
tmp = t_1
else if (z <= 360.0d0) then
tmp = (y * x) / (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 <= -7.5e-9) {
tmp = t_1;
} else if (z <= 360.0) {
tmp = (y * x) / (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 <= -7.5e-9: tmp = t_1 elif z <= 360.0: tmp = (y * x) / (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 <= -7.5e-9) tmp = t_1; elseif (z <= 360.0) tmp = Float64(Float64(y * x) / 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 <= -7.5e-9) tmp = t_1; elseif (z <= 360.0) tmp = (y * x) / (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, -7.5e-9], t$95$1, If[LessEqual[z, 360.0], N[(N[(y * x), $MachinePrecision] / N[(t - z), $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 -7.5 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 360:\\
\;\;\;\;\frac{y \cdot x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.49999999999999933e-9 or 360 < z Initial program 74.0%
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-/.f6486.0%
Simplified86.0%
if -7.49999999999999933e-9 < z < 360Initial program 95.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.1%
Simplified77.1%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -4.8e-12) t_1 (if (<= z 280.0) (* (- 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 <= -4.8e-12) {
tmp = t_1;
} else if (z <= 280.0) {
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 <= (-4.8d-12)) then
tmp = t_1
else if (z <= 280.0d0) 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 <= -4.8e-12) {
tmp = t_1;
} else if (z <= 280.0) {
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 <= -4.8e-12: tmp = t_1 elif z <= 280.0: 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 <= -4.8e-12) tmp = t_1; elseif (z <= 280.0) 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 <= -4.8e-12) tmp = t_1; elseif (z <= 280.0) 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, -4.8e-12], t$95$1, If[LessEqual[z, 280.0], 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 -4.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 280:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.79999999999999974e-12 or 280 < z Initial program 74.4%
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-/.f6485.4%
Simplified85.4%
if -4.79999999999999974e-12 < z < 280Initial program 95.3%
Taylor expanded in t around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6479.3%
Simplified79.3%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6476.3%
Applied egg-rr76.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y z))))) (if (<= z -6.3e-21) t_1 (if (<= z 1.12e-66) (/ (* y 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 <= -6.3e-21) {
tmp = t_1;
} else if (z <= 1.12e-66) {
tmp = (y * 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 <= (-6.3d-21)) then
tmp = t_1
else if (z <= 1.12d-66) then
tmp = (y * 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 <= -6.3e-21) {
tmp = t_1;
} else if (z <= 1.12e-66) {
tmp = (y * 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 <= -6.3e-21: tmp = t_1 elif z <= 1.12e-66: tmp = (y * 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 <= -6.3e-21) tmp = t_1; elseif (z <= 1.12e-66) tmp = Float64(Float64(y * 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 <= -6.3e-21) tmp = t_1; elseif (z <= 1.12e-66) tmp = (y * 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, -6.3e-21], t$95$1, If[LessEqual[z, 1.12e-66], N[(N[(y * x), $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 -6.3 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-66}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.3e-21 or 1.12000000000000004e-66 < z Initial program 77.0%
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-/.f6481.2%
Simplified81.2%
if -6.3e-21 < z < 1.12000000000000004e-66Initial program 95.4%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6470.6%
Simplified70.6%
Final simplification76.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.8e-8) x (if (<= z 1.15e-9) (/ (* y x) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e-8) {
tmp = x;
} else if (z <= 1.15e-9) {
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 <= (-2.8d-8)) then
tmp = x
else if (z <= 1.15d-9) 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 <= -2.8e-8) {
tmp = x;
} else if (z <= 1.15e-9) {
tmp = (y * x) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e-8: tmp = x elif z <= 1.15e-9: tmp = (y * x) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e-8) tmp = x; elseif (z <= 1.15e-9) tmp = Float64(Float64(y * x) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e-8) tmp = x; elseif (z <= 1.15e-9) tmp = (y * x) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e-8], x, If[LessEqual[z, 1.15e-9], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-9}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7999999999999999e-8 or 1.15e-9 < z Initial program 74.4%
Taylor expanded in z around inf
Simplified61.9%
if -2.7999999999999999e-8 < z < 1.15e-9Initial program 95.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6468.0%
Simplified68.0%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (<= z -130000000.0) x (if (<= z 340.0) (* y (/ x t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -130000000.0) {
tmp = x;
} else if (z <= 340.0) {
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 <= (-130000000.0d0)) then
tmp = x
else if (z <= 340.0d0) 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 <= -130000000.0) {
tmp = x;
} else if (z <= 340.0) {
tmp = y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -130000000.0: tmp = x elif z <= 340.0: tmp = y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -130000000.0) tmp = x; elseif (z <= 340.0) 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 <= -130000000.0) tmp = x; elseif (z <= 340.0) tmp = y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -130000000.0], x, If[LessEqual[z, 340.0], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -130000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 340:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3e8 or 340 < z Initial program 73.7%
Taylor expanded in z around inf
Simplified63.7%
if -1.3e8 < z < 340Initial program 94.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6489.8%
Applied egg-rr89.8%
Taylor expanded in z around 0
/-lowering-/.f6462.0%
Simplified62.0%
associate-*l/N/A
*-commutativeN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6463.2%
Applied egg-rr63.2%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (if (<= x 1e+17) (* (/ (- y z) (- t z)) x) (* (- y z) (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1e+17) {
tmp = ((y - z) / (t - z)) * x;
} else {
tmp = (y - z) * (x / (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 (x <= 1d+17) then
tmp = ((y - z) / (t - z)) * x
else
tmp = (y - z) * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1e+17) {
tmp = ((y - z) / (t - z)) * x;
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1e+17: tmp = ((y - z) / (t - z)) * x else: tmp = (y - z) * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1e+17) tmp = Float64(Float64(Float64(y - z) / Float64(t - z)) * x); else tmp = Float64(Float64(y - z) * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1e+17) tmp = ((y - z) / (t - z)) * x; else tmp = (y - z) * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1e+17], N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+17}:\\
\;\;\;\;\frac{y - z}{t - z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if x < 1e17Initial program 88.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.6%
Applied egg-rr95.6%
if 1e17 < x Initial program 77.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.0%
Applied egg-rr97.0%
Final simplification96.0%
(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.3%
Taylor expanded in z around inf
Simplified35.6%
(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 2024193
(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)))