
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - z) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (- a z))))
(if (<= t -130000000000.0)
(fma (- y z) t_1 x)
(if (<= t 1e+27) (+ x (/ (* t (- y z)) (- a z))) (+ x (* (- y z) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a - z);
double tmp;
if (t <= -130000000000.0) {
tmp = fma((y - z), t_1, x);
} else if (t <= 1e+27) {
tmp = x + ((t * (y - z)) / (a - z));
} else {
tmp = x + ((y - z) * t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a - z)) tmp = 0.0 if (t <= -130000000000.0) tmp = fma(Float64(y - z), t_1, x); elseif (t <= 1e+27) tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))); else tmp = Float64(x + Float64(Float64(y - z) * t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -130000000000.0], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], If[LessEqual[t, 1e+27], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - z}\\
\mathbf{if}\;t \leq -130000000000:\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\
\mathbf{elif}\;t \leq 10^{+27}:\\
\;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\_1\\
\end{array}
\end{array}
if t < -1.3e11Initial program 76.8%
+-commutative76.8%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
if -1.3e11 < t < 1e27Initial program 98.6%
if 1e27 < t Initial program 72.8%
associate-/l*99.8%
Simplified99.8%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.9e-69)
(+ t x)
(if (<= z 3e-14)
(+ x (* y (/ t a)))
(if (<= z 4.2e+107) (- x (* t (/ y z))) (+ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-69) {
tmp = t + x;
} else if (z <= 3e-14) {
tmp = x + (y * (t / a));
} else if (z <= 4.2e+107) {
tmp = x - (t * (y / z));
} else {
tmp = t + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d-69)) then
tmp = t + x
else if (z <= 3d-14) then
tmp = x + (y * (t / a))
else if (z <= 4.2d+107) then
tmp = x - (t * (y / z))
else
tmp = t + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-69) {
tmp = t + x;
} else if (z <= 3e-14) {
tmp = x + (y * (t / a));
} else if (z <= 4.2e+107) {
tmp = x - (t * (y / z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-69: tmp = t + x elif z <= 3e-14: tmp = x + (y * (t / a)) elif z <= 4.2e+107: tmp = x - (t * (y / z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-69) tmp = Float64(t + x); elseif (z <= 3e-14) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 4.2e+107) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e-69) tmp = t + x; elseif (z <= 3e-14) tmp = x + (y * (t / a)); elseif (z <= 4.2e+107) tmp = x - (t * (y / z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-69], N[(t + x), $MachinePrecision], If[LessEqual[z, 3e-14], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+107], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-69}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+107}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-69 or 4.1999999999999999e107 < z Initial program 82.0%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in z around inf 80.4%
if -1.8999999999999999e-69 < z < 2.9999999999999998e-14Initial program 94.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 81.7%
*-commutative81.7%
associate-/l*84.9%
Simplified84.9%
if 2.9999999999999998e-14 < z < 4.1999999999999999e107Initial program 96.1%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 76.6%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in a around 0 71.3%
mul-1-neg71.3%
sub-neg71.3%
associate-/l*75.0%
Simplified75.0%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -210000000000.0) (not (<= t 1e+27))) (+ x (* (- y z) (/ t (- a z)))) (+ x (/ (* t (- y z)) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -210000000000.0) || !(t <= 1e+27)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x + ((t * (y - z)) / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-210000000000.0d0)) .or. (.not. (t <= 1d+27))) then
tmp = x + ((y - z) * (t / (a - z)))
else
tmp = x + ((t * (y - z)) / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -210000000000.0) || !(t <= 1e+27)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x + ((t * (y - z)) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -210000000000.0) or not (t <= 1e+27): tmp = x + ((y - z) * (t / (a - z))) else: tmp = x + ((t * (y - z)) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -210000000000.0) || !(t <= 1e+27)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(Float64(t * Float64(y - z)) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -210000000000.0) || ~((t <= 1e+27))) tmp = x + ((y - z) * (t / (a - z))); else tmp = x + ((t * (y - z)) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -210000000000.0], N[Not[LessEqual[t, 1e+27]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -210000000000 \lor \neg \left(t \leq 10^{+27}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot \left(y - z\right)}{a - z}\\
\end{array}
\end{array}
if t < -2.1e11 or 1e27 < t Initial program 74.6%
associate-/l*99.8%
Simplified99.8%
if -2.1e11 < t < 1e27Initial program 98.6%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.46e-85) (not (<= z 4.8e+42))) (+ x (* t (/ (- z y) z))) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.46e-85) || !(z <= 4.8e+42)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.46d-85)) .or. (.not. (z <= 4.8d+42))) then
tmp = x + (t * ((z - y) / z))
else
tmp = x - (y * (t / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.46e-85) || !(z <= 4.8e+42)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.46e-85) or not (z <= 4.8e+42): tmp = x + (t * ((z - y) / z)) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.46e-85) || !(z <= 4.8e+42)) tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.46e-85) || ~((z <= 4.8e+42))) tmp = x + (t * ((z - y) / z)); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.46e-85], N[Not[LessEqual[z, 4.8e+42]], $MachinePrecision]], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{-85} \lor \neg \left(z \leq 4.8 \cdot 10^{+42}\right):\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -1.46e-85 or 4.7999999999999997e42 < z Initial program 83.7%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in a around 0 76.5%
mul-1-neg76.5%
unsub-neg76.5%
associate-/l*91.9%
Simplified91.9%
if -1.46e-85 < z < 4.7999999999999997e42Initial program 94.7%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in y around inf 87.1%
associate-/l*88.0%
Simplified88.0%
clear-num87.9%
un-div-inv87.9%
Applied egg-rr87.9%
associate-/r/90.2%
Applied egg-rr90.2%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e-9) (not (<= z 4.4e+107))) (+ t x) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-9) || !(z <= 4.4e+107)) {
tmp = t + x;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.1d-9)) .or. (.not. (z <= 4.4d+107))) then
tmp = t + x
else
tmp = x - (y * (t / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-9) || !(z <= 4.4e+107)) {
tmp = t + x;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e-9) or not (z <= 4.4e+107): tmp = t + x else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e-9) || !(z <= 4.4e+107)) tmp = Float64(t + x); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e-9) || ~((z <= 4.4e+107))) tmp = t + x; else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e-9], N[Not[LessEqual[z, 4.4e+107]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-9} \lor \neg \left(z \leq 4.4 \cdot 10^{+107}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -2.10000000000000019e-9 or 4.4e107 < z Initial program 80.6%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in z around inf 81.7%
if -2.10000000000000019e-9 < z < 4.4e107Initial program 94.9%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in y around inf 86.7%
associate-/l*88.1%
Simplified88.1%
clear-num88.0%
un-div-inv88.0%
Applied egg-rr88.0%
associate-/r/89.2%
Applied egg-rr89.2%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e-9) (not (<= z 1.82e+109))) (+ t x) (- x (* t (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-9) || !(z <= 1.82e+109)) {
tmp = t + x;
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.1d-9)) .or. (.not. (z <= 1.82d+109))) then
tmp = t + x
else
tmp = x - (t * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-9) || !(z <= 1.82e+109)) {
tmp = t + x;
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e-9) or not (z <= 1.82e+109): tmp = t + x else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e-9) || !(z <= 1.82e+109)) tmp = Float64(t + x); else tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e-9) || ~((z <= 1.82e+109))) tmp = t + x; else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e-9], N[Not[LessEqual[z, 1.82e+109]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-9} \lor \neg \left(z \leq 1.82 \cdot 10^{+109}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.10000000000000019e-9 or 1.82e109 < z Initial program 80.6%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in z around inf 81.7%
if -2.10000000000000019e-9 < z < 1.82e109Initial program 94.9%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in y around inf 86.7%
associate-/l*88.1%
Simplified88.1%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.46e-85) (+ x (* t (/ (- z y) z))) (if (<= z 2.8e+42) (- x (* y (/ t (- z a)))) (- (+ t x) (* t (/ y z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.46e-85) {
tmp = x + (t * ((z - y) / z));
} else if (z <= 2.8e+42) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = (t + x) - (t * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.46d-85)) then
tmp = x + (t * ((z - y) / z))
else if (z <= 2.8d+42) then
tmp = x - (y * (t / (z - a)))
else
tmp = (t + x) - (t * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.46e-85) {
tmp = x + (t * ((z - y) / z));
} else if (z <= 2.8e+42) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = (t + x) - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.46e-85: tmp = x + (t * ((z - y) / z)) elif z <= 2.8e+42: tmp = x - (y * (t / (z - a))) else: tmp = (t + x) - (t * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.46e-85) tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); elseif (z <= 2.8e+42) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(Float64(t + x) - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.46e-85) tmp = x + (t * ((z - y) / z)); elseif (z <= 2.8e+42) tmp = x - (y * (t / (z - a))); else tmp = (t + x) - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.46e-85], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+42], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + x), $MachinePrecision] - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{-85}:\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+42}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;\left(t + x\right) - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1.46e-85Initial program 86.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in a around 0 77.3%
mul-1-neg77.3%
unsub-neg77.3%
associate-/l*89.6%
Simplified89.6%
if -1.46e-85 < z < 2.7999999999999999e42Initial program 94.7%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in y around inf 87.1%
associate-/l*88.0%
Simplified88.0%
clear-num87.9%
un-div-inv87.9%
Applied egg-rr87.9%
associate-/r/90.2%
Applied egg-rr90.2%
if 2.7999999999999999e42 < z Initial program 78.5%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in z around inf 85.2%
associate-+r+85.2%
associate--l+85.2%
distribute-lft-out--85.2%
div-sub85.2%
mul-1-neg85.2%
unsub-neg85.2%
*-commutative85.2%
distribute-lft-out--85.2%
Simplified85.2%
Taylor expanded in y around inf 87.9%
associate-/l*96.4%
Simplified96.4%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.25e+32) (- x (* t (/ y (- z a)))) (if (<= y 1.66e-41) (+ x (* t (/ z (- z a)))) (- x (* y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.25e+32) {
tmp = x - (t * (y / (z - a)));
} else if (y <= 1.66e-41) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-2.25d+32)) then
tmp = x - (t * (y / (z - a)))
else if (y <= 1.66d-41) then
tmp = x + (t * (z / (z - a)))
else
tmp = x - (y * (t / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.25e+32) {
tmp = x - (t * (y / (z - a)));
} else if (y <= 1.66e-41) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.25e+32: tmp = x - (t * (y / (z - a))) elif y <= 1.66e-41: tmp = x + (t * (z / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.25e+32) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (y <= 1.66e-41) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.25e+32) tmp = x - (t * (y / (z - a))); elseif (y <= 1.66e-41) tmp = x + (t * (z / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.25e+32], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e-41], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+32}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{-41}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -2.2500000000000002e32Initial program 82.2%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around inf 75.7%
associate-/l*87.4%
Simplified87.4%
if -2.2500000000000002e32 < y < 1.65999999999999993e-41Initial program 91.1%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in y around 0 87.1%
mul-1-neg87.1%
unsub-neg87.1%
associate-/l*94.3%
Simplified94.3%
if 1.65999999999999993e-41 < y Initial program 89.3%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around inf 83.3%
associate-/l*83.5%
Simplified83.5%
clear-num83.4%
un-div-inv83.4%
Applied egg-rr83.4%
associate-/r/84.7%
Applied egg-rr84.7%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-69) (not (<= z 3.2e+107))) (+ t x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-69) || !(z <= 3.2e+107)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.75d-69)) .or. (.not. (z <= 3.2d+107))) then
tmp = t + x
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-69) || !(z <= 3.2e+107)) {
tmp = t + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-69) or not (z <= 3.2e+107): tmp = t + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-69) || !(z <= 3.2e+107)) tmp = Float64(t + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e-69) || ~((z <= 3.2e+107))) tmp = t + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-69], N[Not[LessEqual[z, 3.2e+107]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-69} \lor \neg \left(z \leq 3.2 \cdot 10^{+107}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.7500000000000001e-69 or 3.20000000000000029e107 < z Initial program 82.0%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in z around inf 80.4%
if -1.7500000000000001e-69 < z < 3.20000000000000029e107Initial program 94.6%
associate-/l*97.9%
Simplified97.9%
clear-num97.8%
un-div-inv97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
associate-/l*78.1%
Simplified78.1%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e-69) (not (<= z 3.5e-9))) (+ t x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-69) || !(z <= 3.5e-9)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.75d-69)) .or. (.not. (z <= 3.5d-9))) then
tmp = t + x
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e-69) || !(z <= 3.5e-9)) {
tmp = t + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e-69) or not (z <= 3.5e-9): tmp = t + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e-69) || !(z <= 3.5e-9)) tmp = Float64(t + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e-69) || ~((z <= 3.5e-9))) tmp = t + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e-69], N[Not[LessEqual[z, 3.5e-9]], $MachinePrecision]], N[(t + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-69} \lor \neg \left(z \leq 3.5 \cdot 10^{-9}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.7500000000000001e-69 or 3.4999999999999999e-9 < z Initial program 84.5%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around inf 74.0%
if -1.7500000000000001e-69 < z < 3.4999999999999999e-9Initial program 94.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 81.1%
*-commutative81.1%
associate-/l*84.2%
Simplified84.2%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (<= z 2e+52) (+ x (* (- y z) (/ t (- a z)))) (- (+ t x) (* t (/ y z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 2e+52) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = (t + x) - (t * (y / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 2d+52) then
tmp = x + ((y - z) * (t / (a - z)))
else
tmp = (t + x) - (t * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 2e+52) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = (t + x) - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 2e+52: tmp = x + ((y - z) * (t / (a - z))) else: tmp = (t + x) - (t * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 2e+52) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(Float64(t + x) - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 2e+52) tmp = x + ((y - z) * (t / (a - z))); else tmp = (t + x) - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 2e+52], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + x), $MachinePrecision] - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+52}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\left(t + x\right) - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < 2e52Initial program 91.5%
associate-/l*97.2%
Simplified97.2%
if 2e52 < z Initial program 76.4%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in z around inf 86.0%
associate-+r+86.0%
associate--l+86.0%
distribute-lft-out--86.0%
div-sub86.0%
mul-1-neg86.0%
unsub-neg86.0%
*-commutative86.0%
distribute-lft-out--86.0%
Simplified86.0%
Taylor expanded in y around inf 89.1%
associate-/l*98.3%
Simplified98.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.75e-70) (not (<= z 1.1e-64))) (+ t x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e-70) || !(z <= 1.1e-64)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.75d-70)) .or. (.not. (z <= 1.1d-64))) then
tmp = t + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e-70) || !(z <= 1.1e-64)) {
tmp = t + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.75e-70) or not (z <= 1.1e-64): tmp = t + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.75e-70) || !(z <= 1.1e-64)) tmp = Float64(t + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.75e-70) || ~((z <= 1.1e-64))) tmp = t + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.75e-70], N[Not[LessEqual[z, 1.1e-64]], $MachinePrecision]], N[(t + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-70} \lor \neg \left(z \leq 1.1 \cdot 10^{-64}\right):\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.75e-70 or 1.1e-64 < z Initial program 84.7%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 72.7%
if -2.75e-70 < z < 1.1e-64Initial program 94.8%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in x around inf 61.2%
Final simplification67.6%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.2%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 55.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024091
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))