
(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 12 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
(let* ((t_1 (/ (* y (- t z)) (- a z))))
(if (<= t_1 (- INFINITY))
(* y (+ (/ (- t z) (- a z)) (/ x y)))
(if (<= t_1 2e-56) (+ x t_1) (+ x (/ (- t z) (/ (- a z) y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (((t - z) / (a - z)) + (x / y));
} else if (t_1 <= 2e-56) {
tmp = x + t_1;
} else {
tmp = x + ((t - z) / ((a - z) / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (((t - z) / (a - z)) + (x / y));
} else if (t_1 <= 2e-56) {
tmp = x + t_1;
} else {
tmp = x + ((t - z) / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (t - z)) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = y * (((t - z) / (a - z)) + (x / y)) elif t_1 <= 2e-56: tmp = x + t_1 else: tmp = x + ((t - z) / ((a - z) / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(t - z)) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(Float64(t - z) / Float64(a - z)) + Float64(x / y))); elseif (t_1 <= 2e-56) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(t - z) / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (t - z)) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (((t - z) / (a - z)) + (x / y)); elseif (t_1 <= 2e-56) tmp = x + t_1; else tmp = x + ((t - z) / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-56], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(t - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \left(\frac{t - z}{a - z} + \frac{x}{y}\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 28.5%
Taylor expanded in y around inf 99.9%
associate--l+99.9%
div-sub99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56Initial program 99.2%
if 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 83.7%
clear-num83.7%
associate-/r/83.6%
Applied egg-rr83.6%
associate-*l/83.7%
*-un-lft-identity83.7%
clear-num83.7%
*-commutative83.7%
associate-/l/99.6%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.45e-147) (+ x (/ (- t z) (/ (- a z) y))) (fma y (/ (- t z) (- a z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.45e-147) {
tmp = x + ((t - z) / ((a - z) / y));
} else {
tmp = fma(y, ((t - z) / (a - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.45e-147) tmp = Float64(x + Float64(Float64(t - z) / Float64(Float64(a - z) / y))); else tmp = fma(y, Float64(Float64(t - z) / Float64(a - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.45e-147], N[(x + N[(N[(t - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-147}:\\
\;\;\;\;x + \frac{t - z}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a - z}, x\right)\\
\end{array}
\end{array}
if x < -1.4500000000000001e-147Initial program 85.9%
clear-num85.9%
associate-/r/85.9%
Applied egg-rr85.9%
associate-*l/85.9%
*-un-lft-identity85.9%
clear-num85.9%
*-commutative85.9%
associate-/l/98.9%
clear-num99.0%
Applied egg-rr99.0%
if -1.4500000000000001e-147 < x Initial program 87.6%
+-commutative87.6%
associate-/l*99.2%
fma-define99.2%
Simplified99.2%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- t z)) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e-56)))
(+ x (/ (- t z) (/ (- a z) y)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e-56)) {
tmp = x + ((t - z) / ((a - z) / y));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e-56)) {
tmp = x + ((t - z) / ((a - z) / y));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (t - z)) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e-56): tmp = x + ((t - z) / ((a - z) / y)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(t - z)) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e-56)) tmp = Float64(x + Float64(Float64(t - z) / Float64(Float64(a - z) / y))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (t - z)) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e-56))) tmp = x + ((t - z) / ((a - z) / y)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e-56]], $MachinePrecision]], N[(x + N[(N[(t - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{-56}\right):\\
\;\;\;\;x + \frac{t - z}{\frac{a - z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 67.7%
clear-num67.7%
associate-/r/67.6%
Applied egg-rr67.6%
associate-*l/67.7%
*-un-lft-identity67.7%
clear-num67.7%
*-commutative67.7%
associate-/l/99.6%
clear-num99.8%
Applied egg-rr99.8%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56Initial program 99.2%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- t z)) (- a z))))
(if (<= t_1 (- INFINITY))
(* y (/ (- t z) (- a z)))
(if (<= t_1 2e+259) (+ x t_1) (* (- z t) (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * ((t - z) / (a - z));
} else if (t_1 <= 2e+259) {
tmp = x + t_1;
} else {
tmp = (z - t) * (y / (z - a));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * ((t - z) / (a - z));
} else if (t_1 <= 2e+259) {
tmp = x + t_1;
} else {
tmp = (z - t) * (y / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (t - z)) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = y * ((t - z) / (a - z)) elif t_1 <= 2e+259: tmp = x + t_1 else: tmp = (z - t) * (y / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(t - z)) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(Float64(t - z) / Float64(a - z))); elseif (t_1 <= 2e+259) tmp = Float64(x + t_1); else tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (t - z)) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = y * ((t - z) / (a - z)); elseif (t_1 <= 2e+259) tmp = x + t_1; else tmp = (z - t) * (y / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+259], N[(x + t$95$1), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{t - z}{a - z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+259}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 28.5%
Taylor expanded in x around 0 28.5%
associate-/l*89.9%
*-commutative89.9%
Applied egg-rr89.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e259Initial program 99.3%
if 2e259 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 43.0%
Taylor expanded in x around 0 43.0%
associate-*l/85.5%
Simplified85.5%
Final simplification97.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.75e+130)
(+ x y)
(if (<= z -1.7e+68)
(* (- z t) (/ y (- z a)))
(if (or (<= z -9.8e+23) (not (<= z 6.6e+50)))
(+ x y)
(+ x (/ (* t y) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+130) {
tmp = x + y;
} else if (z <= -1.7e+68) {
tmp = (z - t) * (y / (z - a));
} else if ((z <= -9.8e+23) || !(z <= 6.6e+50)) {
tmp = x + y;
} 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+130)) then
tmp = x + y
else if (z <= (-1.7d+68)) then
tmp = (z - t) * (y / (z - a))
else if ((z <= (-9.8d+23)) .or. (.not. (z <= 6.6d+50))) then
tmp = x + y
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+130) {
tmp = x + y;
} else if (z <= -1.7e+68) {
tmp = (z - t) * (y / (z - a));
} else if ((z <= -9.8e+23) || !(z <= 6.6e+50)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e+130: tmp = x + y elif z <= -1.7e+68: tmp = (z - t) * (y / (z - a)) elif (z <= -9.8e+23) or not (z <= 6.6e+50): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+130) tmp = Float64(x + y); elseif (z <= -1.7e+68) tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a))); elseif ((z <= -9.8e+23) || !(z <= 6.6e+50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.75e+130) tmp = x + y; elseif (z <= -1.7e+68) tmp = (z - t) * (y / (z - a)); elseif ((z <= -9.8e+23) || ~((z <= 6.6e+50))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+130], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.7e+68], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -9.8e+23], N[Not[LessEqual[z, 6.6e+50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+130}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+68}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{+23} \lor \neg \left(z \leq 6.6 \cdot 10^{+50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -1.75e130 or -1.70000000000000008e68 < z < -9.8000000000000006e23 or 6.6000000000000001e50 < z Initial program 75.7%
Taylor expanded in z around inf 80.5%
+-commutative80.5%
Simplified80.5%
if -1.75e130 < z < -1.70000000000000008e68Initial program 49.5%
Taylor expanded in x around 0 31.8%
associate-*l/82.1%
Simplified82.1%
if -9.8000000000000006e23 < z < 6.6000000000000001e50Initial program 98.4%
Taylor expanded in z around 0 83.3%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+27) (not (<= z 7.2e+22))) (- x (* y (/ (- t z) z))) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+27) || !(z <= 7.2e+22)) {
tmp = x - (y * ((t - z) / z));
} 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 <= (-4.4d+27)) .or. (.not. (z <= 7.2d+22))) then
tmp = x - (y * ((t - z) / z))
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 <= -4.4e+27) || !(z <= 7.2e+22)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+27) or not (z <= 7.2e+22): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+27) || !(z <= 7.2e+22)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.4e+27) || ~((z <= 7.2e+22))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.4e+27], N[Not[LessEqual[z, 7.2e+22]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+27} \lor \neg \left(z \leq 7.2 \cdot 10^{+22}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -4.3999999999999997e27 or 7.2e22 < z Initial program 73.9%
Taylor expanded in a around 0 66.1%
+-commutative66.1%
associate-/l*86.2%
Simplified86.2%
if -4.3999999999999997e27 < z < 7.2e22Initial program 99.1%
Taylor expanded in z around 0 85.3%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e-22) (not (<= a 1400000.0))) (+ x (* y (/ (- t z) a))) (- x (* y (/ (- t z) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e-22) || !(a <= 1400000.0)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x - (y * ((t - z) / 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 ((a <= (-1.6d-22)) .or. (.not. (a <= 1400000.0d0))) then
tmp = x + (y * ((t - z) / a))
else
tmp = x - (y * ((t - z) / z))
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.6e-22) || !(a <= 1400000.0)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x - (y * ((t - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e-22) or not (a <= 1400000.0): tmp = x + (y * ((t - z) / a)) else: tmp = x - (y * ((t - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e-22) || !(a <= 1400000.0)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e-22) || ~((a <= 1400000.0))) tmp = x + (y * ((t - z) / a)); else tmp = x - (y * ((t - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e-22], N[Not[LessEqual[a, 1400000.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-22} \lor \neg \left(a \leq 1400000\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\end{array}
\end{array}
if a < -1.59999999999999994e-22 or 1.4e6 < a Initial program 87.4%
Taylor expanded in a around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*86.5%
Simplified86.5%
if -1.59999999999999994e-22 < a < 1.4e6Initial program 86.3%
Taylor expanded in a around 0 77.0%
+-commutative77.0%
associate-/l*86.1%
Simplified86.1%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e-22) (+ x (* y (/ (- t z) a))) (if (<= a 10.5) (- x (* y (/ (- t z) z))) (+ x (/ (- t z) (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e-22) {
tmp = x + (y * ((t - z) / a));
} else if (a <= 10.5) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((t - z) / (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 (a <= (-1.9d-22)) then
tmp = x + (y * ((t - z) / a))
else if (a <= 10.5d0) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + ((t - z) / (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 (a <= -1.9e-22) {
tmp = x + (y * ((t - z) / a));
} else if (a <= 10.5) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((t - z) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.9e-22: tmp = x + (y * ((t - z) / a)) elif a <= 10.5: tmp = x - (y * ((t - z) / z)) else: tmp = x + ((t - z) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e-22) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (a <= 10.5) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.9e-22) tmp = x + (y * ((t - z) / a)); elseif (a <= 10.5) tmp = x - (y * ((t - z) / z)); else tmp = x + ((t - z) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e-22], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 10.5], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;a \leq 10.5:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -1.90000000000000012e-22Initial program 86.5%
Taylor expanded in a around inf 81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*85.2%
Simplified85.2%
if -1.90000000000000012e-22 < a < 10.5Initial program 86.3%
Taylor expanded in a around 0 77.0%
+-commutative77.0%
associate-/l*86.1%
Simplified86.1%
if 10.5 < a Initial program 88.3%
clear-num88.3%
associate-/r/88.3%
Applied egg-rr88.3%
associate-*l/88.3%
*-un-lft-identity88.3%
clear-num88.3%
*-commutative88.3%
associate-/l/94.0%
clear-num94.1%
Applied egg-rr94.1%
Taylor expanded in z around 0 87.9%
neg-mul-187.9%
distribute-neg-frac287.9%
Simplified87.9%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.22e+28) (not (<= z 6.5e+50))) (+ x y) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.22e+28) || !(z <= 6.5e+50)) {
tmp = x + y;
} 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.22d+28)) .or. (.not. (z <= 6.5d+50))) then
tmp = x + y
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.22e+28) || !(z <= 6.5e+50)) {
tmp = x + y;
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.22e+28) or not (z <= 6.5e+50): tmp = x + y else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.22e+28) || !(z <= 6.5e+50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.22e+28) || ~((z <= 6.5e+50))) tmp = x + y; else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.22e+28], N[Not[LessEqual[z, 6.5e+50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+28} \lor \neg \left(z \leq 6.5 \cdot 10^{+50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -1.2199999999999999e28 or 6.5000000000000003e50 < z Initial program 73.2%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -1.2199999999999999e28 < z < 6.5000000000000003e50Initial program 98.4%
Taylor expanded in z around 0 83.3%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+19) (not (<= z 1.05e+43))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+19) || !(z <= 1.05e+43)) {
tmp = x + 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 ((z <= (-1.9d+19)) .or. (.not. (z <= 1.05d+43))) then
tmp = x + 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 ((z <= -1.9e+19) || !(z <= 1.05e+43)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+19) or not (z <= 1.05e+43): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+19) || !(z <= 1.05e+43)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+19) || ~((z <= 1.05e+43))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+19], N[Not[LessEqual[z, 1.05e+43]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+19} \lor \neg \left(z \leq 1.05 \cdot 10^{+43}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.9e19 or 1.05000000000000001e43 < z Initial program 73.7%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -1.9e19 < z < 1.05000000000000001e43Initial program 98.4%
Taylor expanded in x around inf 59.7%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= z 2e+187) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 2e+187) {
tmp = x;
} else {
tmp = 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 <= 2d+187) then
tmp = x
else
tmp = 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 <= 2e+187) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 2e+187: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 2e+187) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 2e+187) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 2e+187], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+187}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if z < 1.99999999999999981e187Initial program 89.7%
Taylor expanded in x around inf 55.8%
if 1.99999999999999981e187 < z Initial program 60.4%
Taylor expanded in x around 0 33.6%
Taylor expanded in z around inf 59.0%
Final simplification56.1%
(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 86.9%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(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 2024055
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))