
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 84.1%
*-commutative84.1%
associate-*l/98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- t z) z)))))
(if (<= z -2.2e+121)
t_1
(if (<= z -4.5e+33)
(+ x (* t (/ y a)))
(if (or (<= z -7e-120) (not (<= z 1.6e-74)))
t_1
(+ x (/ t (/ a y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.5e+33) {
tmp = x + (t * (y / a));
} else if ((z <= -7e-120) || !(z <= 1.6e-74)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x - (y * ((t - z) / z))
if (z <= (-2.2d+121)) then
tmp = t_1
else if (z <= (-4.5d+33)) then
tmp = x + (t * (y / a))
else if ((z <= (-7d-120)) .or. (.not. (z <= 1.6d-74))) then
tmp = t_1
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 t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.5e+33) {
tmp = x + (t * (y / a));
} else if ((z <= -7e-120) || !(z <= 1.6e-74)) {
tmp = t_1;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t - z) / z)) tmp = 0 if z <= -2.2e+121: tmp = t_1 elif z <= -4.5e+33: tmp = x + (t * (y / a)) elif (z <= -7e-120) or not (z <= 1.6e-74): tmp = t_1 else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.5e+33) tmp = Float64(x + Float64(t * Float64(y / a))); elseif ((z <= -7e-120) || !(z <= 1.6e-74)) tmp = t_1; else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.5e+33) tmp = x + (t * (y / a)); elseif ((z <= -7e-120) || ~((z <= 1.6e-74))) tmp = t_1; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+121], t$95$1, If[LessEqual[z, -4.5e+33], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7e-120], N[Not[LessEqual[z, 1.6e-74]], $MachinePrecision]], t$95$1, N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{+33}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-120} \lor \neg \left(z \leq 1.6 \cdot 10^{-74}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.20000000000000001e121 or -4.5e33 < z < -7e-120 or 1.5999999999999999e-74 < z Initial program 82.2%
*-commutative82.2%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 85.2%
if -2.20000000000000001e121 < z < -4.5e33Initial program 70.0%
Taylor expanded in z around 0 69.8%
+-commutative69.8%
associate-/l*84.8%
Simplified84.8%
clear-num84.8%
associate-/r/84.8%
clear-num84.9%
Applied egg-rr84.9%
if -7e-120 < z < 1.5999999999999999e-74Initial program 91.4%
Taylor expanded in z around 0 80.4%
+-commutative80.4%
associate-/l*86.3%
Simplified86.3%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- t z) z)))))
(if (<= z -2.2e+121)
t_1
(if (<= z -4.8e+33)
(+ x (* t (/ y a)))
(if (<= z -7e-120)
(+ x (/ (- z t) (/ z y)))
(if (<= z 8.2e-75) (+ x (/ t (/ a y))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.8e+33) {
tmp = x + (t * (y / a));
} else if (z <= -7e-120) {
tmp = x + ((z - t) / (z / y));
} else if (z <= 8.2e-75) {
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 - (y * ((t - z) / z))
if (z <= (-2.2d+121)) then
tmp = t_1
else if (z <= (-4.8d+33)) then
tmp = x + (t * (y / a))
else if (z <= (-7d-120)) then
tmp = x + ((z - t) / (z / y))
else if (z <= 8.2d-75) 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 - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.8e+33) {
tmp = x + (t * (y / a));
} else if (z <= -7e-120) {
tmp = x + ((z - t) / (z / y));
} else if (z <= 8.2e-75) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t - z) / z)) tmp = 0 if z <= -2.2e+121: tmp = t_1 elif z <= -4.8e+33: tmp = x + (t * (y / a)) elif z <= -7e-120: tmp = x + ((z - t) / (z / y)) elif z <= 8.2e-75: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.8e+33) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= -7e-120) tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); elseif (z <= 8.2e-75) 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 - (y * ((t - z) / z)); tmp = 0.0; if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.8e+33) tmp = x + (t * (y / a)); elseif (z <= -7e-120) tmp = x + ((z - t) / (z / y)); elseif (z <= 8.2e-75) 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[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+121], t$95$1, If[LessEqual[z, -4.8e+33], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-120], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-75], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+33}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-120}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-75}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.20000000000000001e121 or 8.20000000000000005e-75 < z Initial program 79.4%
*-commutative79.4%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 86.3%
if -2.20000000000000001e121 < z < -4.8e33Initial program 70.0%
Taylor expanded in z around 0 69.8%
+-commutative69.8%
associate-/l*84.8%
Simplified84.8%
clear-num84.8%
associate-/r/84.8%
clear-num84.9%
Applied egg-rr84.9%
if -4.8e33 < z < -7e-120Initial program 93.8%
*-commutative93.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.4%
if -7e-120 < z < 8.20000000000000005e-75Initial program 91.4%
Taylor expanded in z around 0 80.4%
+-commutative80.4%
associate-/l*86.3%
Simplified86.3%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ (- t z) z)))))
(if (<= z -2.2e+121)
t_1
(if (<= z -4.8e+33)
(+ x (* t (/ y a)))
(if (<= z -7e-120)
(+ x (/ y (/ z (- z t))))
(if (<= z 1.5e-74) (+ x (/ t (/ a y))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.8e+33) {
tmp = x + (t * (y / a));
} else if (z <= -7e-120) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.5e-74) {
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 - (y * ((t - z) / z))
if (z <= (-2.2d+121)) then
tmp = t_1
else if (z <= (-4.8d+33)) then
tmp = x + (t * (y / a))
else if (z <= (-7d-120)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 1.5d-74) 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 - (y * ((t - z) / z));
double tmp;
if (z <= -2.2e+121) {
tmp = t_1;
} else if (z <= -4.8e+33) {
tmp = x + (t * (y / a));
} else if (z <= -7e-120) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 1.5e-74) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((t - z) / z)) tmp = 0 if z <= -2.2e+121: tmp = t_1 elif z <= -4.8e+33: tmp = x + (t * (y / a)) elif z <= -7e-120: tmp = x + (y / (z / (z - t))) elif z <= 1.5e-74: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.8e+33) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (z <= -7e-120) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 1.5e-74) 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 - (y * ((t - z) / z)); tmp = 0.0; if (z <= -2.2e+121) tmp = t_1; elseif (z <= -4.8e+33) tmp = x + (t * (y / a)); elseif (z <= -7e-120) tmp = x + (y / (z / (z - t))); elseif (z <= 1.5e-74) 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[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+121], t$95$1, If[LessEqual[z, -4.8e+33], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-120], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-74], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+33}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-120}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-74}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.20000000000000001e121 or 1.50000000000000003e-74 < z Initial program 79.4%
*-commutative79.4%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 86.3%
if -2.20000000000000001e121 < z < -4.8e33Initial program 70.0%
Taylor expanded in z around 0 69.8%
+-commutative69.8%
associate-/l*84.8%
Simplified84.8%
clear-num84.8%
associate-/r/84.8%
clear-num84.9%
Applied egg-rr84.9%
if -4.8e33 < z < -7e-120Initial program 93.8%
Taylor expanded in a around 0 80.5%
+-commutative80.5%
associate-/l*80.5%
Simplified80.5%
if -7e-120 < z < 1.50000000000000003e-74Initial program 91.4%
Taylor expanded in z around 0 80.4%
+-commutative80.4%
associate-/l*86.3%
Simplified86.3%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ y a) (- t z)))))
(if (<= a -1.9e-26)
t_1
(if (<= a 6e-123)
(+ x (/ y (/ z (- z t))))
(if (<= a 8.2e-81)
(+ x (/ (* t y) a))
(if (<= a 6.6e+32) (+ x (* z (/ y (- z a)))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y / a) * (t - z));
double tmp;
if (a <= -1.9e-26) {
tmp = t_1;
} else if (a <= 6e-123) {
tmp = x + (y / (z / (z - t)));
} else if (a <= 8.2e-81) {
tmp = x + ((t * y) / a);
} else if (a <= 6.6e+32) {
tmp = x + (z * (y / (z - a)));
} 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 / a) * (t - z))
if (a <= (-1.9d-26)) then
tmp = t_1
else if (a <= 6d-123) then
tmp = x + (y / (z / (z - t)))
else if (a <= 8.2d-81) then
tmp = x + ((t * y) / a)
else if (a <= 6.6d+32) then
tmp = x + (z * (y / (z - a)))
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 / a) * (t - z));
double tmp;
if (a <= -1.9e-26) {
tmp = t_1;
} else if (a <= 6e-123) {
tmp = x + (y / (z / (z - t)));
} else if (a <= 8.2e-81) {
tmp = x + ((t * y) / a);
} else if (a <= 6.6e+32) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y / a) * (t - z)) tmp = 0 if a <= -1.9e-26: tmp = t_1 elif a <= 6e-123: tmp = x + (y / (z / (z - t))) elif a <= 8.2e-81: tmp = x + ((t * y) / a) elif a <= 6.6e+32: tmp = x + (z * (y / (z - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y / a) * Float64(t - z))) tmp = 0.0 if (a <= -1.9e-26) tmp = t_1; elseif (a <= 6e-123) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (a <= 8.2e-81) tmp = Float64(x + Float64(Float64(t * y) / a)); elseif (a <= 6.6e+32) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y / a) * (t - z)); tmp = 0.0; if (a <= -1.9e-26) tmp = t_1; elseif (a <= 6e-123) tmp = x + (y / (z / (z - t))); elseif (a <= 8.2e-81) tmp = x + ((t * y) / a); elseif (a <= 6.6e+32) tmp = x + (z * (y / (z - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e-26], t$95$1, If[LessEqual[a, 6e-123], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e-81], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e+32], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-123}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{+32}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.90000000000000007e-26 or 6.60000000000000039e32 < a Initial program 80.6%
Taylor expanded in a around inf 71.9%
mul-1-neg71.9%
unsub-neg71.9%
associate-/l*82.7%
Simplified82.7%
associate-/r/84.3%
Applied egg-rr84.3%
if -1.90000000000000007e-26 < a < 5.99999999999999968e-123Initial program 89.3%
Taylor expanded in a around 0 82.4%
+-commutative82.4%
associate-/l*92.0%
Simplified92.0%
if 5.99999999999999968e-123 < a < 8.19999999999999968e-81Initial program 99.8%
Taylor expanded in z around 0 87.3%
if 8.19999999999999968e-81 < a < 6.60000000000000039e32Initial program 77.1%
Taylor expanded in t around 0 67.0%
+-commutative67.0%
associate-*l/83.9%
*-commutative83.9%
Simplified83.9%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+121) (not (<= z 3.3e+71))) (- x (* y (/ (- t z) z))) (- x (* t (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+121) || !(z <= 3.3e+71)) {
tmp = x - (y * ((t - z) / z));
} 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.2d+121)) .or. (.not. (z <= 3.3d+71))) then
tmp = x - (y * ((t - z) / z))
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.2e+121) || !(z <= 3.3e+71)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x - (t * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+121) or not (z <= 3.3e+71): tmp = x - (y * ((t - z) / z)) else: tmp = x - (t * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+121) || !(z <= 3.3e+71)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); 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.2e+121) || ~((z <= 3.3e+71))) tmp = x - (y * ((t - z) / z)); else tmp = x - (t * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+121], N[Not[LessEqual[z, 3.3e+71]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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.2 \cdot 10^{+121} \lor \neg \left(z \leq 3.3 \cdot 10^{+71}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.20000000000000001e121 or 3.2999999999999998e71 < z Initial program 73.8%
*-commutative73.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 91.2%
if -2.20000000000000001e121 < z < 3.2999999999999998e71Initial program 90.8%
Taylor expanded in t around inf 84.1%
associate-*r/88.9%
neg-mul-188.9%
distribute-rgt-neg-in88.9%
distribute-neg-frac88.9%
Simplified88.9%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+123) (not (<= z 4.8e+71))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+123) || !(z <= 4.8e+71)) {
tmp = x + y;
} 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 <= (-4.3d+123)) .or. (.not. (z <= 4.8d+71))) then
tmp = x + y
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 <= -4.3e+123) || !(z <= 4.8e+71)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+123) or not (z <= 4.8e+71): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+123) || !(z <= 4.8e+71)) tmp = Float64(x + y); 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 <= -4.3e+123) || ~((z <= 4.8e+71))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+123], N[Not[LessEqual[z, 4.8e+71]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+123} \lor \neg \left(z \leq 4.8 \cdot 10^{+71}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.29999999999999986e123 or 4.79999999999999961e71 < z Initial program 73.8%
Taylor expanded in z around inf 83.1%
+-commutative83.1%
Simplified83.1%
if -4.29999999999999986e123 < z < 4.79999999999999961e71Initial program 90.8%
*-commutative90.8%
associate-*l/97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 76.0%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.9e-157) (not (<= z 1.75e-75))) (+ x y) (/ t (/ a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.9e-157) || !(z <= 1.75e-75)) {
tmp = x + y;
} else {
tmp = 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 <= (-2.9d-157)) .or. (.not. (z <= 1.75d-75))) then
tmp = x + y
else
tmp = 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 <= -2.9e-157) || !(z <= 1.75e-75)) {
tmp = x + y;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.9e-157) or not (z <= 1.75e-75): tmp = x + y else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.9e-157) || !(z <= 1.75e-75)) tmp = Float64(x + y); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.9e-157) || ~((z <= 1.75e-75))) tmp = x + y; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.9e-157], N[Not[LessEqual[z, 1.75e-75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-157} \lor \neg \left(z \leq 1.75 \cdot 10^{-75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -2.89999999999999988e-157 or 1.74999999999999993e-75 < z Initial program 81.3%
Taylor expanded in z around inf 67.2%
+-commutative67.2%
Simplified67.2%
if -2.89999999999999988e-157 < z < 1.74999999999999993e-75Initial program 91.7%
Taylor expanded in x around 0 59.4%
Taylor expanded in z around 0 49.7%
associate-/l*57.7%
Simplified57.7%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.4e-194) x (if (<= x 2.3e-150) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.4e-194) {
tmp = x;
} else if (x <= 2.3e-150) {
tmp = y;
} 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 (x <= (-1.4d-194)) then
tmp = x
else if (x <= 2.3d-150) then
tmp = y
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 (x <= -1.4e-194) {
tmp = x;
} else if (x <= 2.3e-150) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.4e-194: tmp = x elif x <= 2.3e-150: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.4e-194) tmp = x; elseif (x <= 2.3e-150) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.4e-194) tmp = x; elseif (x <= 2.3e-150) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.4e-194], x, If[LessEqual[x, 2.3e-150], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-194}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-150}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.40000000000000006e-194 or 2.30000000000000003e-150 < x Initial program 85.8%
Taylor expanded in x around inf 56.7%
if -1.40000000000000006e-194 < x < 2.30000000000000003e-150Initial program 78.2%
Taylor expanded in x around 0 69.6%
Taylor expanded in z around inf 34.4%
Final simplification51.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.06e+157) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.06e+157) {
tmp = x;
} else {
tmp = x + 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 (a <= (-1.06d+157)) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.06e+157) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.06e+157: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.06e+157) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.06e+157) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.06e+157], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.06 \cdot 10^{+157}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.06e157Initial program 70.6%
Taylor expanded in x around inf 43.7%
if -1.06e157 < a Initial program 86.0%
Taylor expanded in z around inf 61.0%
+-commutative61.0%
Simplified61.0%
Final simplification58.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 84.1%
Taylor expanded in x around inf 46.5%
Final simplification46.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024011
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))