
(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 11 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 (+ x (/ t (/ (- a z) (- y z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - 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 + (t / ((a - z) / (y - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / ((a - z) / (y - z)));
}
def code(x, y, z, t, a): return x + (t / ((a - z) / (y - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t / Float64(Float64(a - z) / Float64(y - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t / ((a - z) / (y - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{\frac{a - z}{y - z}}
\end{array}
Initial program 87.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.2%
associate-*r/86.2%
mul-1-neg86.2%
distribute-rgt-neg-out86.2%
associate-*l/90.3%
associate-*l/95.4%
distribute-lft-in96.2%
+-commutative96.2%
sub-neg96.2%
associate-*l/87.1%
associate-*r/98.8%
Simplified98.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ z (- z a))))))
(if (<= z -3.5e+68)
t_1
(if (<= z -2.5e-66)
(- x (* t (/ y z)))
(if (<= z 1.65e-92) (+ x (/ t (/ a y))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (z / (z - a)));
double tmp;
if (z <= -3.5e+68) {
tmp = t_1;
} else if (z <= -2.5e-66) {
tmp = x - (t * (y / z));
} else if (z <= 1.65e-92) {
tmp = x + (t / (a / y));
} 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 + (t * (z / (z - a)))
if (z <= (-3.5d+68)) then
tmp = t_1
else if (z <= (-2.5d-66)) then
tmp = x - (t * (y / z))
else if (z <= 1.65d-92) then
tmp = x + (t / (a / y))
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 + (t * (z / (z - a)));
double tmp;
if (z <= -3.5e+68) {
tmp = t_1;
} else if (z <= -2.5e-66) {
tmp = x - (t * (y / z));
} else if (z <= 1.65e-92) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (z / (z - a))) tmp = 0 if z <= -3.5e+68: tmp = t_1 elif z <= -2.5e-66: tmp = x - (t * (y / z)) elif z <= 1.65e-92: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -3.5e+68) tmp = t_1; elseif (z <= -2.5e-66) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.65e-92) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (z / (z - a))); tmp = 0.0; if (z <= -3.5e+68) tmp = t_1; elseif (z <= -2.5e-66) tmp = x - (t * (y / z)); elseif (z <= 1.65e-92) tmp = x + (t / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+68], t$95$1, If[LessEqual[z, -2.5e-66], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-92], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-92}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.49999999999999977e68 or 1.64999999999999999e-92 < z Initial program 79.2%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in y around 0 77.5%
associate-*r/77.5%
mul-1-neg77.5%
distribute-rgt-neg-out77.5%
associate-*l/88.4%
associate-*l/95.2%
distribute-lft-in95.2%
+-commutative95.2%
sub-neg95.2%
associate-*l/79.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in y around 0 66.0%
associate-*r/66.0%
sub-neg66.0%
remove-double-neg66.0%
distribute-neg-in66.0%
+-commutative66.0%
sub-neg66.0%
distribute-neg-frac266.0%
distribute-neg-frac66.0%
mul-1-neg66.0%
remove-double-neg66.0%
associate-*r/82.5%
Simplified82.5%
if -3.49999999999999977e68 < z < -2.49999999999999981e-66Initial program 95.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 93.8%
Taylor expanded in a around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*76.5%
Simplified76.5%
if -2.49999999999999981e-66 < z < 1.64999999999999999e-92Initial program 95.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around 0 83.3%
+-commutative83.3%
associate-/l*87.0%
Simplified87.0%
clear-num87.0%
un-div-inv87.0%
Applied egg-rr87.0%
Final simplification83.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.05e+91)
(+ x t)
(if (<= z -1.02e-68)
(- x (* t (/ y z)))
(if (<= z 1.52e+22) (+ x (/ t (/ a y))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e+91) {
tmp = x + t;
} else if (z <= -1.02e-68) {
tmp = x - (t * (y / z));
} else if (z <= 1.52e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
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.05d+91)) then
tmp = x + t
else if (z <= (-1.02d-68)) then
tmp = x - (t * (y / z))
else if (z <= 1.52d+22) then
tmp = x + (t / (a / y))
else
tmp = x + t
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.05e+91) {
tmp = x + t;
} else if (z <= -1.02e-68) {
tmp = x - (t * (y / z));
} else if (z <= 1.52e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.05e+91: tmp = x + t elif z <= -1.02e-68: tmp = x - (t * (y / z)) elif z <= 1.52e+22: tmp = x + (t / (a / y)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e+91) tmp = Float64(x + t); elseif (z <= -1.02e-68) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.52e+22) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.05e+91) tmp = x + t; elseif (z <= -1.02e-68) tmp = x - (t * (y / z)); elseif (z <= 1.52e+22) tmp = x + (t / (a / y)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e+91], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.02e-68], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.52e+22], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+91}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-68}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.05000000000000004e91 or 1.52e22 < z Initial program 73.3%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in z around inf 72.1%
if -1.05000000000000004e91 < z < -1.01999999999999997e-68Initial program 96.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 88.5%
Taylor expanded in a around 0 72.4%
mul-1-neg72.4%
unsub-neg72.4%
associate-/l*75.4%
Simplified75.4%
if -1.01999999999999997e-68 < z < 1.52e22Initial program 95.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
associate-/l*83.9%
Simplified83.9%
clear-num84.0%
un-div-inv84.0%
Applied egg-rr84.0%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.3e-39) (not (<= y 4.2e-85))) (+ x (/ t (/ (- a z) y))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.3e-39) || !(y <= 4.2e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (t * (z / (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 <= (-3.3d-39)) .or. (.not. (y <= 4.2d-85))) then
tmp = x + (t / ((a - z) / y))
else
tmp = x + (t * (z / (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 <= -3.3e-39) || !(y <= 4.2e-85)) {
tmp = x + (t / ((a - z) / y));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.3e-39) or not (y <= 4.2e-85): tmp = x + (t / ((a - z) / y)) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.3e-39) || !(y <= 4.2e-85)) tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.3e-39) || ~((y <= 4.2e-85))) tmp = x + (t / ((a - z) / y)); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.3e-39], N[Not[LessEqual[y, 4.2e-85]], $MachinePrecision]], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-39} \lor \neg \left(y \leq 4.2 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -3.29999999999999985e-39 or 4.2e-85 < y Initial program 87.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around 0 85.7%
associate-*r/85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
associate-*l/86.8%
associate-*l/94.9%
distribute-lft-in96.1%
+-commutative96.1%
sub-neg96.1%
associate-*l/87.2%
associate-*r/98.8%
Simplified98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 87.8%
if -3.29999999999999985e-39 < y < 4.2e-85Initial program 86.9%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.9%
associate-*r/86.9%
mul-1-neg86.9%
distribute-rgt-neg-out86.9%
associate-*l/96.3%
associate-*l/96.3%
distribute-lft-in96.2%
+-commutative96.2%
sub-neg96.2%
associate-*l/86.9%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 82.0%
associate-*r/82.0%
sub-neg82.0%
remove-double-neg82.0%
distribute-neg-in82.0%
+-commutative82.0%
sub-neg82.0%
distribute-neg-frac282.0%
distribute-neg-frac82.0%
mul-1-neg82.0%
remove-double-neg82.0%
associate-*r/94.0%
Simplified94.0%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.8e-40) (not (<= y 4.8e-85))) (+ x (* y (/ t (- a z)))) (+ x (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.8e-40) || !(y <= 4.8e-85)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (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 <= (-1.8d-40)) .or. (.not. (y <= 4.8d-85))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t * (z / (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 <= -1.8e-40) || !(y <= 4.8e-85)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.8e-40) or not (y <= 4.8e-85): tmp = x + (y * (t / (a - z))) else: tmp = x + (t * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.8e-40) || !(y <= 4.8e-85)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.8e-40) || ~((y <= 4.8e-85))) tmp = x + (y * (t / (a - z))); else tmp = x + (t * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.8e-40], N[Not[LessEqual[y, 4.8e-85]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-40} \lor \neg \left(y \leq 4.8 \cdot 10^{-85}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if y < -1.8e-40 or 4.8000000000000001e-85 < y Initial program 87.2%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around inf 87.0%
if -1.8e-40 < y < 4.8000000000000001e-85Initial program 86.9%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.9%
associate-*r/86.9%
mul-1-neg86.9%
distribute-rgt-neg-out86.9%
associate-*l/96.3%
associate-*l/96.3%
distribute-lft-in96.2%
+-commutative96.2%
sub-neg96.2%
associate-*l/86.9%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in y around 0 82.0%
associate-*r/82.0%
sub-neg82.0%
remove-double-neg82.0%
distribute-neg-in82.0%
+-commutative82.0%
sub-neg82.0%
distribute-neg-frac282.0%
distribute-neg-frac82.0%
mul-1-neg82.0%
remove-double-neg82.0%
associate-*r/94.0%
Simplified94.0%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.4e+76) (not (<= z 1.7e+22))) (+ x t) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.4e+76) || !(z <= 1.7e+22)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
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.4d+76)) .or. (.not. (z <= 1.7d+22))) then
tmp = x + t
else
tmp = x + (t / (a / y))
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.4e+76) || !(z <= 1.7e+22)) {
tmp = x + t;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.4e+76) or not (z <= 1.7e+22): tmp = x + t else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.4e+76) || !(z <= 1.7e+22)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.4e+76) || ~((z <= 1.7e+22))) tmp = x + t; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.4e+76], N[Not[LessEqual[z, 1.7e+22]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+76} \lor \neg \left(z \leq 1.7 \cdot 10^{+22}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -1.3999999999999999e76 or 1.7e22 < z Initial program 74.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 72.0%
if -1.3999999999999999e76 < z < 1.7e22Initial program 95.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 76.0%
+-commutative76.0%
associate-/l*78.4%
Simplified78.4%
clear-num78.4%
un-div-inv78.4%
Applied egg-rr78.4%
Final simplification75.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+78) (not (<= z 1.96e+21))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+78) || !(z <= 1.96e+21)) {
tmp = x + t;
} 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 <= (-2.8d+78)) .or. (.not. (z <= 1.96d+21))) then
tmp = x + t
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 <= -2.8e+78) || !(z <= 1.96e+21)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+78) or not (z <= 1.96e+21): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+78) || !(z <= 1.96e+21)) tmp = Float64(x + t); 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 <= -2.8e+78) || ~((z <= 1.96e+21))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+78], N[Not[LessEqual[z, 1.96e+21]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+78} \lor \neg \left(z \leq 1.96 \cdot 10^{+21}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.8000000000000001e78 or 1.96e21 < z Initial program 74.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 72.0%
if -2.8000000000000001e78 < z < 1.96e21Initial program 95.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 76.0%
+-commutative76.0%
associate-/l*78.4%
Simplified78.4%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+78) (not (<= z 2e+21))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+78) || !(z <= 2e+21)) {
tmp = x + t;
} 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 <= (-3.2d+78)) .or. (.not. (z <= 2d+21))) then
tmp = x + t
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 <= -3.2e+78) || !(z <= 2e+21)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+78) or not (z <= 2e+21): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+78) || !(z <= 2e+21)) tmp = Float64(x + t); 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 <= -3.2e+78) || ~((z <= 2e+21))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+78], N[Not[LessEqual[z, 2e+21]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+78} \lor \neg \left(z \leq 2 \cdot 10^{+21}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.19999999999999994e78 or 2e21 < z Initial program 74.1%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 72.0%
if -3.19999999999999994e78 < z < 2e21Initial program 95.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 91.4%
Taylor expanded in a around inf 77.2%
Final simplification75.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.75e-216) (not (<= z 4.4e-35))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e-216) || !(z <= 4.4e-35)) {
tmp = x + t;
} 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-216)) .or. (.not. (z <= 4.4d-35))) then
tmp = x + t
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-216) || !(z <= 4.4e-35)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.75e-216) or not (z <= 4.4e-35): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.75e-216) || !(z <= 4.4e-35)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.75e-216) || ~((z <= 4.4e-35))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.75e-216], N[Not[LessEqual[z, 4.4e-35]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-216} \lor \neg \left(z \leq 4.4 \cdot 10^{-35}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.74999999999999995e-216 or 4.39999999999999987e-35 < z Initial program 82.2%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 65.2%
if -2.74999999999999995e-216 < z < 4.39999999999999987e-35Initial program 96.6%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 58.7%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 87.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 86.2%
associate-*r/86.2%
mul-1-neg86.2%
distribute-rgt-neg-out86.2%
associate-*l/90.3%
associate-*l/95.4%
distribute-lft-in96.2%
+-commutative96.2%
sub-neg96.2%
associate-*l/87.1%
associate-*r/98.8%
Simplified98.8%
(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 87.1%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around inf 51.5%
(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 2024137
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))